How exactly does JavaScript defer work?

In JavaScript, the defer attribute is used in the <script> tag to indicate that the script should be executed after the HTML document has been fully parsed. When the browser encounters a script with the defer attribute, it will continue parsing the HTML document while simultaneously downloading the script in the background. The script, however,… Continue reading How exactly does JavaScript defer work?

‘toReversed’ method in JavaScript

The method ‘toReversed()’ is added to JavaScript in ECMAScript 2023 (ES 13) version. The advantage of this method over ‘reverse()’ is that it doesn’t change the original array. It reverses the array and returns a new array. Below is the example code for it and the output: x=[1,2,3,4,5]; x.reverse(); console.log(‘The reverse method applied and the… Continue reading ‘toReversed’ method in JavaScript

Published
Categorized as JavaScript Tagged