You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.
Stringify something like new Number(7); or new Number('hello');
It should output '7' and '"hello"'. Instead it becomes:
new Number(7); became:
{}
new String('hello'); became:
{"0":"h","1":"e","2":"l","3":"l","4":"o"}
Now, I don't have a strong opinion on that. Actually, I think treating them as objects is perfectly fine because they are objects (note that one should probably never really construct a primitive in serious code, but whatever). The main reason I'm filing this as a bug is because the implementation of the browser vendors is different, and we should aim to mach that.
From timotijhof on June 13, 2012 18:15:33
Stringify something like
new Number(7);
ornew Number('hello');
It should output '7' and '"hello"'. Instead it becomes:
new Number(7); became:
{}
new String('hello'); became:
{"0":"h","1":"e","2":"l","3":"l","4":"o"}
Now, I don't have a strong opinion on that. Actually, I think treating them as objects is perfectly fine because they are objects (note that one should probably never really construct a primitive in serious code, but whatever). The main reason I'm filing this as a bug is because the implementation of the browser vendors is different, and we should aim to mach that.
Original issue: http://code.google.com/p/jquery-json/issues/detail?id=60
The text was updated successfully, but these errors were encountered: