JSON.stringify() applies the following rules:
String objects (new String( ' false ' )) Are converted to their primitive string values . So:
new String( " false " ) → " false "
Boolean objects (new Boolean(false)) Convert to their primitive boolean value :
new Boolean(false) → false
Undefined values inside arrays According to the JSON specification, undefined becomes null when stringifying an array:
JSON.stringify([undefined]) → " [null] "
Therefore, the array becomes:
[ " false " , false, null]
And JSON.stringify wraps it in quotes:
' [ " false " , false, null] '
This is exactly option A.
JavaScript Knowledge References (text-only)
Object wrappers (String, Boolean) are converted to primitives during JSON serialization.
undefined becomes null inside arrays when stringified.
JSON.stringify() follows the JSON data-model rules strictly.
==================================================