Background: Today review a piece of code to lead to my question, the code is as follows:

 if (a === 'null') {
     //
 }
Copy the code

Q: How do null and strings interconvert?

  1. Null is converted to a string
let a = null + ' ';
Copy the code
  1. The ‘null’ string is converted to NULL
let a = JSON.parse('null'); // null
Copy the code