| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
#
##
###
####
#####
######
#######It may be useful to know that you can find the length of a string by writing .length after it.
FizzBuzz Write a program that uses console.log to print all the numbers from 1 to 100, with two exceptions. For numbers divisible by 3, print "Fizz" instead of the number, and for numbers divisible by 5 (and not 3), print "Buzz" instead. When you have that working, modify your program to print "FizzBuzz" for numbers that are divisible by both 3 and 5 (and still print "Fizz" or "Buzz"for numbers divisible by only one of those).
Maximum Math.max returns its largest argument. We can build something like that now. Write a function findMax that takes three arguments and returns their maxiumum. Without method Math.max method.
console.log(findMax(0, 10, 5));
10
console.log(findMax(0, -10,-2));
0console.log(reverseArray(["A", "B", "C"]));
["C", "B", "A"]console.log(modifyArray(["Avocado", "Tomato", "Potato","Mango", "Lemon","Carrot"]);
// →["Avocado", "Tomato", "Potato","Mango", "LEMON", "Carrot"]
console.log(modifyArray(["Google", "Facebook","Apple", "Amazon","Microsoft", "IBM"]);
// →["Google", "Facebook","Apple", "Amazon","MICROSOFT", "IBM"]
console.log(modifyArray(["Google", "Facebook","Apple", "Amazon"]);
// →"Not Found"6.Write a function which returns array of seven random numbers in a range of 0-9. All the numbers must be unique
sevenRandomNumbers()
[1,4,5,7,9,8,0]sum(1,2,3)
6
sum(1,2,3,4)
10removeMiddleItem([1,2,3], 4,5,6)
[1,4,5,6,3]
removeMiddleItem([1,2,3,4], 4,5,6)
[1,4,5,6,4]Calculate the total annual income of the person by extracting the following text. 'He earns 5000 euro from salary per month, 10000 euro annual bonus, 15000 euro online courses per month.'
Create a function that takes two strings and returns true if the first argument ends with the second argument; otherewise return false . Take two strings as arguments. Determine if second string matches ending of first string. Return boolean value. Example
yourFunc("integrity", "ity")
true
yourFunc("integration", "tio")
false
yourFunc("connection", "sion")
false
yourFunc("connection", "tion")
true| Back | FazBrowse Home | New Git URL |