Getting started with Javascript in Salesforce

There are multiple ways to learn JavaScript for building Lighting web components in Salesforce.

  1. Trailhead Module: Salesforce TrailHead is the first point of source to learn the Java script which mainly talks about the  for LWC components The below Trailhead module designed to provider better idea on Javascript which is related to LWC components.

    Learn to work with Java script: https://trailhead.salesforce.com/en/content/learn/trails/learn-to-work-with-javascript

  2. Mozilla Developer Network (MDN): The MDN web docs is an excellent resource for web developers. It gives an in-depth explanation of almost all concepts in JavaScript(including ES6) CSS and HTML.
    MDN is super helpful if you want to fully understand any topic and their browser compatibility.
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference
  3. JavaScript Info: This is another excellent source with different examples on JavaScript platform .
    https://javascript.info/

As per salesforce, below are the currently supported Javascripts for lightning web components

To develop Lightning web components, use the latest versions of JavaScript.

Lightning Web Components JavaScript support includes:

ES6 (ECMAScript 2015)
ES7 (ECMAScript 2016)
ES8 (ECMAScript 2017)—excluding Shared Memory and Atomics
ES9 (ECMAScript 2018)—including only Object Spread Properties (not Object Rest Properties)
Static public fields—currently at TC39 Stage 3

A huge benefit of the Lightning Web Components programming model is that you write standard JavaScript code. Salesforce developers are contributing members of the
Ecma International Technical Committee 39 (TC39), which is the committee that evolves JavaScript. Salesforce is also a member of the World Wide Web Consortium (W3C).