What is the meaning of "passed array is frozen" in the context of template strings in ES2015?
Source: http://node.green
It doesn't mean any special in the context of template strings. It just means that the array is frozen. From the docs:
An object is frozen if and only if it is not extensible, all its properties are non-configurable, and all its data properties (that is, properties which are not accessor properties with getter or setter components) are non-writable.
So the array of strings that is getting passed into the tag function is essentially immutable. This is supposed to allow engines to store it as a constant and repeatedly pass the same array object every time the tagged template literal is evaluated.
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