Why does strict mode activator "use strict" string?

Do not confuse it with the desire to learn how strict work works, but why is strict mode activated with 'use strict';or "use strict";in contrast to a type expression use strict;?

+4
source share
2 answers

use strict; will cause an error on JS machines that do not support strict mode.

Using a string is backward compatible.

+11
source

, . , ECMAScript a.k.a javascript . , ? , 'use strict' , use strict. , .

-1

Source: https://habr.com/ru/post/1694991/


All Articles