- A
- B
- C
- DNone of the bove
- DNone of the bove
Time Taken:
Correct Answer:
Wrong Answer:
Percentage: %
The
The parseInt() function takes a string as input and returns an integer.
If the string cannot be converted to an integer, the function returns NaN.
The split() function splits a string into an array of substrings based on a specified delimiter.
The delimiter can be a character, a string, or a regular expression.
The sort() function sorts the elements of an array in ascending order.
By default, it compares the elements as strings.
You can pass a comparison function as an argument to sort the elements in a different way.
The substring() function extracts a part of a string and returns a new string.
It takes two arguments: the start index and the end index (optional).
The extracted part includes the characters from the start index to the end index (not including the character at the end index).
The encodeURIComponent() function encodes a string as a URI component.
It replaces certain characters (such as spaces and special characters) with their encoded version,
which can be safely used in a URI.
A higher-order function is a function that either returns another function or takes another function as an argument, or both.
Higher-order functions are a powerful tool in functional programming because they allow you to create new functions by combining and modifying existing ones.
A closure is a function that has access to the outer function's variables even after the outer function has returned.
Closures are created when a function is defined inside another function and the inner function has access to the outer function's variables.
Closures are often used to create private variables and to preserve state in callback functions.
In this case, the greet function is a property of an object, and the this keyword refers to that object.
In this case, the add function is defined before it is called, so the function call is successful and returns the sum of the two numbers, 15.