Skip to content

Latest commit

 

History

History
36 lines (20 loc) · 1.6 KB

voidwebdev.md

File metadata and controls

36 lines (20 loc) · 1.6 KB

Developer Mudassar Ali

Tip # 1 - Optional Chanining

Option chaining has arrived in TypeScript

optional-chaning Read more: TypeScript 3.7

Tip # 2 - Convert Number to String using .. and ()

num-conversion

Tip # 3 - Replace all intances of String

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

replace-all

Tip # 4 - ES - JS by Reference vs Value

  • Javascript is always pass by value, but when a variable refers to an object (including arrays), the "value" is a reference to the object.
  • Changing the value of a variable never changes the underlying primitive or object, it just points the variable to a new primitive or object.
  • However, changing a property of an object 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:

reference-vs-value

Example - 2

reference-vs-value

⬆️ Back to top