Strict mode is a way to opt in to a restricted version of JavaScript. It helps catch common coding mistakes and prevents the use of certain features that can lead to bugs, such as using undeclared variables.
'use strict';
var x = 3.14; // Error in strict mode: assignment to undeclared variable
Tags: intermediate, JavaScript, strict mode
URL: https://www.tiktok.com/@jsmentoring/photo/7449392707455175968