In a recent interview, I was asked what is JavaScript…and I froze. I have been coding using JavaScript for the past 6 months but I had never thought to define it before. So before I begin explaining some key features of ES6 (ECMA Script 6), I thought I would give you a definition of JavaScript so you don’t freeze as I did!

JavaScript is a dynamic, high-level, lightweight programming language most commonly used to automate and animate web pages. It is a loosely-typed , synchronous language with object-oriented capabilities.

Javascript conforms to the ECMAScript specification which aims to create a general-purpose scripting language. ES6, which was released in June 2015 brings new features that make your code more readable, allowing you to write less code and do more. Let’s take a look at some new features….

Let and Const:

  • const is an **immutable variable **— it cannot be reassigned.
  • let is a mutable** variable — **can be reassigned and take a new value.
  • Both let and const are blocked-scope (only available within its scope).
  • It is preferable to use const instead of var because var is ‘hoisted’. Hoisting is JavaScripts default behaviour which is to move all declaration at the top of the scope before the code is executed which means JavaScript can use the component before its declaration

#women-in-tech #javascript #interview #es6 #code

JavaScript ES6 Interview Cheat Sheet
1.90 GEEK