When you want a JavaScript file (or function) to be parsed in "strict mode" you can put..
"use strict";
..in the top of your JavaScript file (or function).
This "use strict"; is a so-called "pragma".
My question: what exactly is a pragma? The closest thing I can think of is a "directive".
Pragma is short for pragmatic information. So, simple. In plain English, pragmatic is an adjective that means sensible and practical.
The term pragmatism is derived from the Greek word pragma - πράγμα, meaning action, from which the words 'practice' and 'practical' come.
The PRAGMA statement is an SQL extension specific to SQLite and used to modify the operation of the SQLite library or to query the SQLite library for internal (non-table) data.
compiler directives are called pragmas (short for "pragmatic information").
http://en.wikipedia.org/wiki/Preprocessor_directive
It's a pre-processor directive, or like code metadata. It's similar to other languages or compilers that use stuff like this more. It's pragmatic information about how to interpret the code that follows.
And as far as I know, this is the only one in JavaScript. It's sort of a hack to force modern interpreters to behave in a certain way, but without breaking older interpreters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With