Below all the available challenges and some relative examples.
-
- NAME:
round
- DESCRIPTION: Write a function that round a number to given decimal places.
round(Math.PI, 2); // => 3.14
- NAME:
-
- NAME:
arrayMerge
- DESCRIPTION: Write a function that merges multiple given arrays.
arrayMerge([1, 2], [3, 4]); // => [1, 2, 3, 4]
- NAME:
-
- NAME:
arraySum
- DESCRIPTION: Write a function to sum the content of an array.
arraySum([1, 2, 3]) // => 6
- NAME:
-
- NAME:
objectForEach
- DESCRIPTION: Write a forEach function that works with Objects.
var obj = { first_name: 'Elon', last_name: 'Musk' } objectForEach(obj, (key, value) => { console.log(key, value) }) //=> 'first_name', 'Elon' //=> 'last_name', 'Musk'
- NAME:
-
- NAME:
reverseString
- DESCRIPTION: Write a function that reverse a string.
reverseString('hello world!') //=> '!dlrow olleh'
- NAME:
-
- NAME:
isPalindrome
- DESCRIPTION: Write a function that checks if a word is a palindrome.
isPalindrome('level') //=> true isPalindrome('racecar') //=> true
- NAME:
-
- NAME:
isMultipleOf
- DESCRIPTION: Write a function that checks if a number is multiple of another number.
isMultipleOf(15, 3) //=> true isMultipleOf(15, 5) //=> true
- NAME:
-
- NAME:
longestWord
- DESCRIPTION: Write a function that returns the longest word of a sentence.
longestWord('Hello beautiful people!') //=> 'beautiful' longestWord('aaaa bbb cc d eeee') //=> 'aaaa'
- NAME:
-
- NAME:
capitalize
- DESCRIPTION: Write a function that capitalize each word in a sentence.
capitalize('hello world') //=> 'Hello World'
- NAME:
-
- NAME:
vowelCount
- DESCRIPTION: Write a function that count vowel in a sentence.
vowelCount('hello') //=> 2
- NAME:
-
- NAME:
maxChar
- DESCRIPTION: Get the most used char in a sentence.
maxChar('hello world') //=> {count: 3, char: 'l'}
- NAME:
-
- NAME:
fizzBuzz
- DESCRIPTION: Fizz Buzz game, generate number from 0 to 100 and if the number is multiple of 3 print "Fizz", if mutliple of 5 print "Buzz", if is multiple of both print "FizzBuzz" else print the number.
fizzBuzz(); //=> 1 //=> 2 //=> fizz //=> 4 //=> buzz //=> fizz //=> 7 //=> 8 //=> fizz //=> buzz
- NAME:
-
- NAME:
simpleAdding
- DESCRIPTION: Write a function that sums all numbers from 0 to the given number.
simpleAdding(3) //=> 6
- NAME:
-
- NAME:
arrayToTree
- DESCRIPTION: Transform an array into a tree like object.
arrayToTree(['folder', 'subfolder', 'file.txt']) //=> [{name: 'folder', children: [ { name: 'subfolder', children: [ {name: 'file.txt'} ]} ]}]
- NAME:
-
- NAME:
alphabeticallySort
- DESCRIPTION: Write a function that can be used into an
Array.sort()
for sorting items alphabetically.
var myArray = ['Italy', 'Canada', 'Germany']; var mySortedArray = myArray.sort(alphabeticallySort) //=> ['Canada', 'Germany', 'Italy']
- NAME:
-
- NAME:
firstRecurringChar
- DESCRIPTION: Write a function that returns the furst recurring character in a string.
firstRecurringChar('abacyb') //=> 'a'
- NAME:
-
- NAME:
objectMerge
- DESCRIPTION: Write a function that returns an object that includes all given objects.
/* Example usage */ const user = [ { first: 'john' }, { last: 'doe' } ]; objectMerge({ first: 'john' }, { last: 'doe' }); /* OR */ objectMerge(user);
- NAME: