Identical to Object.create but for Arrays and Functions.

This method will allow you to create arrays with no prototype.

This would allow authors the ability to use array objects as state
containers without the need to resort to index-based objects with

Object.create(null, length)

When you want to both use an array-like struct as both a property and
index-able map.

A side-effect of this would afford engines a strong heuristic for avoiding
holey-array look-ups operations when there's no prototype to walk.

For example the following would create an array with a length of 1000
without "holes".

const arr = Array.create(null, 1000)

In addition this could also apply to functions with

Function.create(null, () => {})

When you want to use functions as state-containers but don't want any of
the implicit properties(length, name) etc.
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to