-
Create a function named
sum
that returns the sum of two numbers.sum(2, 3) // Output: 5 sum(7, -59); // Output: -52 sum() // Output: false sum("2", 2) // Output : false sum(false, 3) // Output: false sum(2, []) // Output: false sum({}, 7) // Output: false
-
Create a function named
reverseString
that returns the reverse of a given string.reverseString("hello"); // Output: "olleh" reverseString("Grace Hopper"); // Output: "reppoH ecarG" reverseString(); // Output: false reverseString(2) // Output: false reverseString([]) // Output: false reverseString({}) // Output: false
-
Create a function named
findLargestNumber
that returns the largest number from an array of numbers.findLargestNumber([4, 9, 2, 7, 5]); // Output: 9 findLargestNumber([1, 2, 3, 4, 5]); // Output: 5 findLargestNumber() // Output: false findLargestNumber("A string) // Output: false findLargestNumber(["a", "string"]) // Output: false
-
Create a function named
checkEvenOrOdd
that checks if a number is even or odd.checkEvenOrOdd(2) // Output: "Even" checkEvenOrOdd(7) // Output: "Odd" checkEvenOrOdd("") // Output: false checkEvenOrOdd([]) // Output: false
-
Create a function named
convertToFahrenheit
that converts a temperature from Celsius to Fahrenheit.convertToFahrenheit("") // Output: false convertToFahrenheit(20) // Output: 68 convertToFahrenheit(-10) // Output: 14 convertToFahrenheit([1,2,3]) // Output: false
-
Notifications
You must be signed in to change notification settings - Fork 1
gocodeup/extra-js1-practice
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Extra JavaScript Practice With Jasmin Test Suite
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published