ES2023 introduced the Array.with() method, providing a safe way to update elements in an array without modifying the original array.
| const months = [“Januar”, “Februar”, “Mar”, “April”]; const new = months.with(2, “March”); |
A shebang is a combination of a number sign and an exclamation mark (#!) placed at the beginning of a script.
| #!/usr/bin/env node |
The example uses a shebang (#!) to let the OS run the script with node, enabling ./fileName.js instead of node fileName.js.