Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js pad array

function padArray(arr, size, fill=null) {
  return arr.concat(Array(size - arr.length).fill(fill));
}
 
PREVIOUS NEXT
Tagged: #js #pad #array
ADD COMMENT
Topic
Name
2+1 =