How I am getting Output = 1 for console.log('6'/'6') in Javascript. It should not be able to devide two strings
When a mathematical operator that only makes sense on numbers is applied to two expressions, both expressions are coerced to numbers first..
4. Let lnum be ? ToNumeric(lval).
5. Let rnum be ? ToNumeric(rval).
7. 7. Let operation be the abstract operation associated with opText and Type(lnum) in the following table:
...
which then calls Number::divide with lnum and rnum.
The only exception is +, which will only add if both sides are numbers - otherwise, it will coerce both sides to strings and then concatenate.