Function eqeq()
is the reimplementation of JavaScript coercion
specified in ECMAScript 3.
Coercion includes implicit type casting. It happens when you use == (eqeq) operator to compare two values with different types.
This code is made to understand how native JavaScript works.
The code uses explicit String()
and Number()
type conversions.
References: