Compare commits

...

2 Commits

Author SHA1 Message Date
15da478201 tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-07-31 10:50:20 +03:00
8c97e3f073 typo fix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-07-30 10:08:21 +03:00

View File

@ -159,22 +159,22 @@
undefined == null // -> true
// But in cases where the same operation is defined for both types
// the result may seem less predictable, for example `+` defines both
// number addition and string concatination:
// the result may *seem* less predictable, for example `+` defines both
// number addition and string concatenation:
1 + 2 // -> 3
'a' + 'b' // -> 'ab'
// But when mixed it reverts to constructor:
// But when mixed it reverts to concatenation:
1 + '2' // -> '12'
// This feature can both help make the code simpler and more generic if
// used conciously and at the same time can prove quite frustrating if
// used consciously and at the same time can prove quite frustrating if
// neglected.
//
// This neglect and carelessness is the main reason it is quite popular
// to avoid type coercion and instead overuse strict comparisons and
// deffensively over-check everything, at times raised to such levels as
// to define whole languages (like TypeScript) around this.
// Note that this neglect and carelessness is the main reason it is quite
// popular to avoid type coercion and instead overuse strict comparisons
// and defensively over-check everything, at times raised to such levels
// as to define whole languages around this (like TypeScript).
// Type checking