/ Published in: JavaScript
Object.create(null) is a more memory-efficient way to make objects, but it's not supported in all versions of JavaScript, so you can do the "old-fashioned" {} if that function isn't available.
Expand |
Embed | Plain Text
Evan.emptyObject = function() { if (Object.create) return Object.create(null); return {}; };
You need to login to post a comment.
