Write a function with one number
argument that returns double the argument.
Write a function with two number
arguments that returns double the first argument.
- Function `double2` not found in index.js, did you export it?
Write a function with two number
arguments that returns double the largest argument.
- Function `double3` not found in index.js, did you export it?
Write a function with a string
argument and a number
argument that repeates the string from the first argument but repeated the amount of times equal to the second argument. If the second number is negative, return an empty string.
- Function `repeat` not found in index.js, did you export it?
Write a function without any arguments. Have it return the string 'na'
repeated 10 times followed by the string ' batman!'
. Use the repeat
function you used before to accomplish this.
- Function `batman` not found in index.js, did you export it?
Write a function with two number
arguments. Have it return the largest number of the two.
- Function `max` not found in index.js, did you export it?
Write a function with two number
arguments. Have it return the smallest number of the two divided by the largest number.
- Function `maxDivide` not found in index.js, did you export it?
Write a function with two string
arguments. Have it return the longest string.
- Function `maxStr` not found in index.js, did you export it?
Write a function with a single number
argument. Return a boolean that indicated wether this number is even.
use the
%
(remainder) operator to determine if something is divisible by something else. Read about it here.
- Function `even` not found in index.js, did you export it?
Write a function with a single number
argument. Return an array of all the numbers lower than this argument that are even.
- Function `evenBelow` not found in index.js, did you export it?
Write a function with a single array of numbers
argument. Return an array of all the numbers in this array that are even.
- Function `evenIn` not found in index.js, did you export it?
Write a function with a single array of numbers
argument. Return the result of multiplying all the numbers. If the input contains just 1 number, return that number.
- Function `multiplyArray` not found in index.js, did you export it?
Write a function with a single array of numbers
argument. Return the result of dividing the number from left to right. So the first number gets divided by the second and the result of that gets divided by the third (and so on..). If the array contains a zero, return zero. If the array contains just one number, return that number.
- Function `divideArray` not found in index.js, did you export it?
Write a function with two string
arguments. Split both strings in halves and recombine the halves. Return the longest results of the two combinations (or the first one if both have the same length).
- Function `splitCombine` not found in index.js, did you export it?
Write a function with one {name: string}
argument. Return the name property.
- Function `getName` not found in index.js, did you export it?
Write a function with one [{name: string}]
(list of object) argument. Return an array with all the name properties.
- Function `getNames` not found in index.js, did you export it?
Write a function with one [{firstname: string, lastname: string}]
(list of object) argument. Return an array with all the full names (both the first and the last name as a single string with a space in between them).
- Function `combineName` not found in index.js, did you export it?
Write a function with one [{country: string}]
(list of object) argument. Return an array with every unique country value in the input array.
- Function `uniqueCountries` not found in index.js, did you export it?
Write a function with one [{country: string}]
(list of object) argument. Return an object with all the unique values as keys and the amount of occurences as value.
- Function `countCountries` not found in index.js, did you export it?
Write a function with one [number]
argument. Return the highest number.
- Function `highestNumber` not found in index.js, did you export it?
Write a function with one [number]
argument. Return the average.
Write a function with one [number]
argument. Return the mode (most frequent value).
Write a function with one string
argument. Return the reversed string.
Write a function with one string
argument. Return true or false wether this string is a palindrome.
A palindrome is a string that stays the same when you reverse it. Like 'Bob' or 'Racecar'.
Write a function with one number
argument. Have it log a pyramid of that size.
Write a function that takes two [number]
arguments and return an array that contains all numers that are in both arrays.
Write a function that takes two {key:value} (objects)
arguments and return an array that contains all the keys that are in both objects.
Write a function that takes two {key:value} (objects)
arguments and return an array that contains all the values that are in both objects.
Write a function that takes two {key:value} (objects)
arguments and return an array that contains all the keys that are in both object which have the same value.
Write a function that takes two {key:value} (objects)
arguments and return an array that contains all the keys that are only in one of the two objects.
Write a function that takes a [{}] (array of objects)
argument, every object will have an id
key (which is a number). Return an array with all the objects having a even number as key.
Write a function that takes a [[]] (array of arrays)
argument, remove the longest array and return the result. If there are multiple array that are the longest, remove both.
Write a function that takes a [{id:number, power:boolean}] (array of objects)
and a number
argument. Toggle the power
bool from false to true or from true to false if the id matches the second argument and return the result.
Write a function that takes a string
. Return the string with the seperate words in the reverse order.
javascript reverseSentence("We are Codaisseur") === "Codaisseur are we" // this is true
Write a function that takes a number
. Return a boolean if the number stays the same when reverted.