JavaScript / nodejs [JavaScript] Function to check if something is an array and if not, return it as array May 19, 2022 July 10, 2023 Arrays, function, helper, isArray, JavaScript, nodejs const asArray = x => Array.isArray(x) ? x : [ x ]