- Write a function called "addFive". Given a number, "addFive" returns 5 added to that number.
- Write a function called "getOpposite". If the given value is an integer, return its opposite value, otherwise return -1
- Fill in your code that takes an number minutes and converts it to seconds.
- Create a function that takes a string and returns it as an integer.
- Create a function that takes a number as an argument, increments the number by +1 and returns the result.
- Create a function that takes an array and returns the first element.
- Write a function that converts hours into seconds.
- Create a function that takes height and width and finds the perimeter of a rectangle.
- Given two numbers, return true if the sum of both numbers is less than 100. Otherwise return false. 10.There is a single operator in JavaScript, capable of providing the remainder of a division operation. Two numbers are passed as parameters. The first parameter divided by the second parameter will have a remainder, possibly zero. Return that value.
- MacDonald is asking you to tell him how many legs can be counted among all his animals. The farmer breeds three species: turkey = 2 legs horse = 4 legs pigs = 4 legs The farmer has counted his animals and he gives you a subtotal for each species. You have to implement a function that returns the total number of legs of all the animals. 12.Create a function that returns the number of frames shown in a given number of minutes for a certain FPS.
- Create a function that returns true if an integer is evenly divisible by 5, and false otherwise.
- Write a function called "isEven". "isEven" Should return whether it is even or not. Return -1 for invalid input
- Given a first and a last name, "getFullName" returns a single string with the given first and last names separated by a single space.
- Given a word, "getLengthOfWord" returns the length of the given word.
- Given two words, "isSameLength" returns whether the given words have the same length.
- Create a function to calculate the distance between two points defined by their x, y coordinates.
- Given an array and an integer, "getNthElement" returns the element at the given integer, within the given array. If the array has a length of 0, it should return ‘undefined’. 20.Given an array, "getLastElement" returns the last element of the given array. If the given array has a length of 0, it should return '-1'. 21.Given an object and a key, "getProperty" returns the value of the property at the given key. If there is no property at the given key, it should return null.
- Given an object and a key, "addProperty" adds a new property on the given object with a value of true.
- Given an object and a key, "removeProperty" removes the given key from the given object.