In this challenge, the task is to implement a function inventoryList such that maintains the collection of items existing in an inventory.
It returns a new object with three methods;
-
add(name) - adds an item to the to the collection, if it does not already exist in the collection
-
remove(name) - remove an item ion the collection if exists, if it does not exist, nothing happens
-
getList() - returns an array of items so far
A Function to check whether two given strings are anagram of each other or not.
- An anagram of a string is another string that contains the same characters, only the order of characters can be different. For example, “abcd” and “dabc” are an anagram of each other.
- The function returns
true
if two strings are anagrams, elsefalse