5 interesting features of JavaScript you may not know

Tram Ho

JavaScript must be nothing strange anymore, right guys. But do you know all its interesting features yet?

With each new release of JavaScript, there will be interesting features such as adding new methods, or new operators to help you code more concise and easier to read.

In this article, I will introduce to you 5 interesting features of JavaScript that you may not know. Come find out with me.

1. Numeric Separator

Before typing large numbers up to millions or billions, it was very difficult to read it. But now you can use  _  to separate numbers so you can read them quickly.

This feature is actually quite useful, isn’t it?

2. replaceAll

In previous JavaScript to be able to replace all a string into another, we needed to use a regular expression, such as this:

But now we have the method replaceAll

3. Object.entries

Object.keysObject.values developers already use it a lot, but there are still Object.entries It’s also quite useful to iterate over each Object’s key:value pair

4. designMode of chrome

This feature is a useful feature for Frontend developers as there is no need to inspect the element and fix it, we can now edit it directly on the web page.

Just open the console and type the following code

It is quite handy when you need to change the text to preview how the text will display on your web. Try this cool feature right now

5. Use the logical operator

Previously you used logical operators like ||&&??=== put in conditional sentences if/else right. But there is a more useful way to use it.

Here’s how to use operators to be able to assign values to variables

Or you can use operators to call functions.

Similar to the rest of the operators you can also do.

Summary

Above I have introduced to you interesting features for developers.

Hope it can be of great help to you. Hope you have a productive day at work and study.

See you in my next posts. Thank you all.

Share the news now