How to Control JavaScript's Strict Mode
https://jskatas.org/blog/2023/10/16-control-strict-mode/
#ycombinator #javascript #learning #coding #kata #es6_katas #koans #training #practice #exercises #challenges #programming_skills #code_kata #tests #unit_tests #course
https://jskatas.org/blog/2023/10/16-control-strict-mode/
#ycombinator #javascript #learning #coding #kata #es6_katas #koans #training #practice #exercises #challenges #programming_skills #code_kata #tests #unit_tests #course
How to Control Strict Mode
I was surprised to see that the worker threads run in non-strict mode by default.This should rarely happen, because when using ES modules (ESMs), classes or `"use strict"` then the engine forces strict mode.I didn't know this in the beginning.I have been working on the katas I use for this site in the [javascript-katas repo](https://codeberg.org/wolframkriesing/javascript-katas) which uses ESMs and `type=module`, my default. This makes the entire nodejs project, any `npm ...` command run use strict mode.Escaping from strict mode is not easily possible, but one way to run code in non-strict mode is by using a worker thread.
Hacker News