1 min read

ECMAScript 2009 - ES5

JavaScript was invented by Brendan Eich in 1995, and became an ECMA standard in 1997.ECMAScript is the official name of the language.ECMAScript versions have been abbreviated to ES1, ES2, ES3, ES5, and ES6.Since 2016 new versions are named by year (ECMAScript 2016 / 2017 / 2018).
ECMAScript 2009 - ES5

ECMAScript 2009, also known as ES5, was the first major revision to JavaScript.This chapter describes the most important features of ES5.

ES5 Features

  • "use strict"
  • String.trim()
  • Array.isArray()
  • Array.forEach()
  • Array.map()
  • Array.indexOf()
  • Array.lastIndexOf()
  • JSON.parse()
  • JSON.stringify()

"use strict" defines that the JavaScript code should be executed in "strict mode".

String.trim() removes whitespace from both sides of a string.

var str = "       Hello World!        ";  alert(str.trim());

The isArray() method checks whether an object is an array.

The forEach() method calls a function once for each array element.

The indexOf()Search an array for an element value and returns its position.

Array.lastIndexOf() is the same as Array.indexOf(), but searches from the end of the array.

The JavaScript function JSON.parse() is used to convert the text into a JavaScript object.

Use the JavaScript function JSON.stringify() to convert it into a string.

JavaScript ES5
https://www.w3schools.com/js/js_es5.asp

#JavaScript #ES5 #ECMAScript #Probyto #Probyto AI

Subscribe and follow us for latest news in Data Science and Machine learning and stay updated!

Facebook: https://facebook.com/probyto
Twitter: https://twitter.com/probyto
LinkedIn: https://linkedin.com/company/probyto
Instagram: https://instagram.com/probyto