Why JavaScript is important for LWC?
– As you know LWC is using the core concept of web standards, and JavaScript is the main programming or scripting language to handle web applications.
LWC uses ES6(2015), ES7(2016), ES8(2017), ES9(2018), ES10(2019), and ES11(2020) versions of JavaScript, these versions are the modern version of JavaScript.
Which tasks are handled by JavaScript?
– Shadow Down, Web components, Custom elements, modules, ECMAScript7, Events, Standard elements, rendering, Templates, and slots are handled by JavaScript in LWC, that is the reason LWC components are doing Better performance and giving Better security.
Important topics in JavaScript which is useful in LWC:
*Variables: Variables are the containers for storing data values.
var, const, and let are the reserved keyword to declare a variable.
*Data types: There are 8 data types in JavaScript:
Number, string, boolean, bigInt, undefined, null, object, symbol
*Arrow function: An arrow function expression is a compact alternative to a traditional function expression.
*Spread operators: The operators shape is tree consecutive dots and is written as: …
*Destructuring: Destructuring is a special syntax that allows us to “unpack” arrays or objects into a bunch of variables as sometimes that’s more convenient.
*String Interpolation: String interpolation allows you to embed expressions in the string.
*String method: JavaScript provides many methods to play with strings. below are some of the most commonly used strings method in LWC.
includes(), indexOf(), startsWith(), slice(), toLowerCase(), toUpperCase(), trim()
*Object method: JavaScript methods are actions that can be performed on objects.
*Array method: Arrays provide a lot of methods. To make things easier: map(), every(), filter(), some(), sort(), reduce(), forEach() etc.
*Promises: the promise is an object that may produce a single value some time in the future promise are used to handle asynchronous operations in JavaScript.
*Events: A event is an action that occurs in the web browser, which the web browser feedbacks to you so that you can respond to it.
This trailhead will help you to clear the JavaScript developer 1 certification: https://trailhead.salesforce.com/credentials/javascriptdeveloperi
JavaScript for LWC training tutorial: https://www.youtube.com/watch?v=yDuW2eFSX24&list=PL0BxZWA0ZhM0STFtq1-4lKtNehGwkQvJM