Developer Mudassar Ali
Option chaining has arrived in TypeScript
Read more: TypeScript 3.7
Replacing all occurrences of a substring with another string is a common operation. Unfortunately, doing this correctly is surprisingly hard in JavaScript. 🤯 The new String.prototype.replaceAll API is here to help! 🎉 - Mathias Bynens
- Javascript is always pass by
value
, but when a variable refers to an object (including arrays), the"value"
is areference
to theobject
. - Changing the value of a variable never changes the underlying
primitive
orobject
, it just points the variable to a new primitive or object. - However, changing a
property
of anobject
referenced by a variable does change the underlying object.
Follow the link to learn more about the problem, Passing value by Reference vs Value
Check the following examples below:
Example - 2