Javascript-functions

JavaScript String toLowerCase() Method

In JavaScript, the toLowerCase() method converts the string into lowercase. It doesn’t accept any parameter and can be accessed through dot notation.

JavaScript String toUpperCase() Method

The toUpperCase() method converts the string into uppercase. For example, if the string is javascript then the toUpperCase() method would return JAVASCRIPT.

How to Push an Element into an Array in JavaScript?

The push() method pushes new elements into the array in JavaScript. It accepts multiple comma-separated values in parameters for pushing them into the array.

How to use Ternary Operator in JavaScript?

A shortened version of the condition statement is called the ternary operator. Ternary operators can be simple or nested.

How does the replace() Method Work in JavaScript?

The JavaScript built-in method replace() searches the specified string and returns a new string after replacing it. It accepts two parameters

How to Convert Float to Integer in JavaScript?

JavaScript’s built-in function parseInt() converts float value into an integer. It accepts float value in the first parameter and converts it.

How to Convert String into Integer in JavaScript?

To convert a string value into an integer we can use the parseInt() function in JavaScript. It accepts two parameters in which the first is required and the second is optional.