Jemt / Fit.UI

Fit.UI is a JavaScript based UI framework built on Object Oriented principles
http://fitui.org
GNU Lesser General Public License v3.0
19 stars 7 forks source link

Fit.Core.Clone(..) replaces undefined in arrays with null #183

Open Jemt opened 1 year ago

Jemt commented 1 year ago

Arrays containing undefined will have this "value" replaced by null as the following example demonstrates:

Fit.Core.Clone({ List: ["a", undefined, "c"] }); outputs { List: ["a", null, "c"] }

The problem is related to the Clone function's internal use of JSON.stringify(..) which behaves exactly like that: JSON.stringify(["a", undefined, "b"]) outputs ["a", null, "c"]