50- Javascript Practice Exercises by Zayn
50- Javascript Practice Exercises by Zayn
Practice Exercises
Beginners to Advanced
*Beginner Level:
Console Output:
Looping:
Functions:
Functions:
*String Manipulation:*:
*Conditional:*:
*Conditional:*:
Objects*
*Event Listeners:*
*Higher-Order Functions:*
*Higher-Order Functions:*
*Array Methods:*
*Array Methods:*
Error Handling:*
Recursion
Recursion
*Closures
*Closures
Prototypes:*
Async Programming -
Callbacks:*
Async Programming -
Promises:*
Async Programming -
Promises:*
Async Programming -
Async/Await:*
Async Programming -
Async/Await:*
Set Interval:*
Set Timeout:*
Regular Expressions:*
Multidimensional Array:
Destructuring:*
Class:*
Prototypal Inheritance:*
Random Exercise*
Random Exercise*
Random Exercise*
Random Exercise*
Random Exercise*
Create a function that takes a string as an argument. The function
must return a string containing 1s and 0s based on the string
argument's words. If any word in the argument is not equal to "zero" or
"one" (case insensitive), you should ignore it. The returned string's
length should be a multiple of 8, if the string is not a multiple of 8 you
should remove the numbers in excess.
textToNumberBinary("Zero one zero ONE zero one zero one") ➞ "01010101"
textToNumberBinary("zero one zero one zero one zero one one two") ➞ ""
Random Exercise*
Create a function that takes in a sentence and returns a
running list of consonants per word and vowels per word.
Random Exercise*
Create a function that takes the month and year (as integers) and
returns the number of days in that month.
days(2, 2018) ➞ 28
days(4, 654) ➞ 30
Advanced Level:*
Random Exercise*
Given two integers representing the numerator and
denominator of a fraction, return the fraction in string format.
Input: numerator = 1, denominator = 2
Output: "0.5"