Top 10 JavaScript Features

Muhammad Shahnewaz
May 5 · 3 min read

Some important javascript features

If you want to be a JavaScript programmer, you must know these things.

01. Number: If the value of a variable is expressed by a number, then it is called a number-type variable. If the value cannot be converted then it shows NaN. JavaScript number has many types : isNaN(), parseInt(), parseFloat() etc.

Number.isNaN(): This method for checking if something is not a number and its type is a Number.

Example:

Number.parseInt(): This method converts a string to an integer (a whole number).

Example:

Number.parseFloat(): This method converts a string to a point number.

Example:

02. String: If the value of a variable is expressed with one or more letters, then it is called a string-type variable. When we express one or more value letters, then the thing will start with a quotation and end with a quotation. JavaScript string have many types : concat(), replace(), indexof(), toUppercase(), toLowercase() etc.

Concat(): This method will combine two or more strings and returns a new string.

Example:

trim(): This method removes any white space from the left and right sides of the string.

Example:

03. Math: This method is an object that provides several methods and properties to execute the mathematical operations JavaScript math object has many types: abs(), ceil(), floor(), random(), etc.

Math.abs(): This method provides the absolute value of a given number. It can be written as: Math.abs(y); [where y is a number].

Example:

Math.floor(): This method gives a larger number that is less than or equal to the given integer.

Example:

Math.random(): This method returns a random number in the range between 0 and 1.

Example:

04. Array: When a variable has more than one value, then it is called an array. To write an array, we first need to put a comma between the two values. Then, we have to give a square bracket to put all the values in a box. JavaScript array have many types: foreach(), shift(), map(), find(), filter(), join() etc.

joint(): This method joins all elements of an array as a string.

Example;

shift(): This method removes and returns the first element of an array.

Example:

05. Boolean:: If the value of a variable is expressed by true or false, then it is called a boolean type variable.

Example:

06. Variable: Variable means where data is stored. To declare a variable, we have to write the reserved keyword var of JavaScript. Then we have to give a name to the variable. This means what variable it is, whether it is a person, or the thing, etc. Then we have to give an equal sign. Then, we have to write a value, which means any person can have a name, age, height, and name of any object, etc. Then, we have to give a semicolon. Remember, the name of the variable must be meaningful. Javascript has three reserved keywords for declaring variables: let and cost.

Example:

07. Switch: ‘Switch’ is a lot like if-else but there are some differences between them. Efficiently, if we want to apply conditions on something then we will use the switch method.

Example:

08. While-Loop: While loop is a conditional loop. As long as the condition allows, it will be executed. To write a while loop, we have to write the reserved keyword while of JavaScript. Then we have to give parentheses (). Then, we need to write a condition in a round bracket. Lastly, we have to give a curly bracket {}.

Example:

09. Function: When we do the same thing over and over again but want to change it as we wish, then we will use the function method. By applying the function method we can use the same function in different places. First of all, we will type the function keyword of javascript to write a function. Then, we will give two parentheses with the name of the function and two curly brackets.

Example:

10. Closure: When a function is able to remember and access its lexical scope even when that function executing outside its lexical scope.

Example:

Nerd For Tech

From Confusion to Clarification

Nerd For Tech

NFT is an Educational Media House. Our mission is to bring the invaluable knowledge and experiences of experts from all over the world to the novice. To know more about us, visit https://www.nerdfortech.org/. Don’t forget to check out Ask-NFT, a mentorship ecosystem we’ve started

Muhammad Shahnewaz

Written by

Web Developer

Nerd For Tech

NFT is an Educational Media House. Our mission is to bring the invaluable knowledge and experiences of experts from all over the world to the novice. To know more about us, visit https://www.nerdfortech.org/. Don’t forget to check out Ask-NFT, a mentorship ecosystem we’ve started

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store