diff --git a/Userland/Libraries/LibJS/Runtime/Array.h b/Userland/Libraries/LibJS/Runtime/Array.h index 75204547a07..8ba454912ea 100644 --- a/Userland/Libraries/LibJS/Runtime/Array.h +++ b/Userland/Libraries/LibJS/Runtime/Array.h @@ -28,6 +28,12 @@ public: static NonnullGCPtr create_from(Realm&, Vector const&); static NonnullGCPtr create_from(Realm&, ReadonlySpan const&); + template + static NonnullGCPtr create_from(Realm& realm, Value const (&values)[N]) + { + return create_from(realm, ReadonlySpan { values, N }); + } + // Non-standard but equivalent to CreateArrayFromList. template static NonnullGCPtr create_from(Realm& realm, ReadonlySpan elements, Function map_fn)