What does this line of code mean?


#1

Hi there. Please do not be fooled by the so called category this is listed under. I could not find the correct subject, so if any of you can do so, please add a category in JavaScript for “Learn JavaScript: Browser Compatability and Transpiliation”

So, getting right to the point. So after I went through the excercise no. 5 i noticed that in the es5 translation it had:

"use strict";

and i was wondering what that line of code does if anyone knows.

all original code below:
“use strict”;

var pasta = "Spaghetti"; // ES5 syntax

var meat = "Pancetta"; // ES6 syntax

var sauce = "Eggs and cheese"; // ES6 syntax

// Template literals, like the one below, were introduced in ES6
var carbonara = "You can make carbonara with " + pasta + ", " + meat + ", and a sauce made with " + sauce + 
".";

es6 version below:

var pasta = "Spaghetti"; // ES5 syntax

const meat = "Pancetta"; // ES6 syntax

let sauce = "Eggs and cheese"; // ES6 syntax

// Template literals, like the one below, were introduced in ES6
const carbonara = `You can make carbonara with ${pasta}, ${meat}, and a sauce made with ${sauce}.`;

#2

Strict Mode