Code to go logo
Created using Figma
Use Cases
Contribute
How to empty array in JavaScript
Arrays
By Jad Joubran ·
Last updated Dec 16, 2017
const apps = ["phone", "calculator", "clock"]; apps.length = 0; console.log(apps);
[]
Dec 16, 2017
1
Jad Joubran
See answer
1
Jad Joubran
Array.length
on MDN
Learn JavaScript step by step