www.codereplica.com

JavaScript important

Functions{}

www.codereplica.com

setTimeout()

This function is used to delay the execution of a function. For example, setTimeout(myFunction, 3000) would call the myFunction after 3 seconds.

www.codereplica.com

setInterval()

This function is used to delay the execution of a function. For example, setTimeout(myFunction, 3000) would call the myFunction after 3 seconds.

www.codereplica.com

setInterval()

This function is used to execute a function repeatedly at a specified interval. For example, setInterval(myFunction, 3000) would call the myFunction every 3 seconds.

www.codereplica.com

map()

This function is used to create a new array with the results of calling a provided function on every element in the calling array.

www.codereplica.com

filter()

This function creates a new array with all elements that pass the test implemented by the provided function.

www.codereplica.com

reduce()

This function applies a function against an accumulator and each value of the array (from left-to-right) to reduce it to a single value

www.codereplica.com

parseInt()

This function parses a string and returns an integer. For example, parseInt("3.14") would return 3.

www.codereplica.com

parseFloat()

Similar to parseInt(), this function parses a string and returns a floating-point number. For example, parseFloat("3.14") would return 3.14.

www.codereplica.com

isNaN()

This function is used to check if a value is not a number. For example, isNaN("hello") would return true.

www.codereplica.com

encodeURI()

This function is used to encode a URI (Uniform Resource Identifier) by replacing certain characters with their encoded counterparts.

www.codereplica.com

decodeURI()

This function is the opposite of encodeURI(), and is used to decode an encoded URI.