Homelab, Linux, JS & ABAP (~˘▾˘)~
 

[JavaScript] Function to check if something is an array and if not, return it as array

const asArray = x => Array.isArray(x) ? x : [ x ]

Leave a Reply

Your email address will not be published. Required fields are marked *