Categories JavaScript Answers How to empty an array in JavaScript? Post author By John Au-Yeung Post date September 14, 2022 No Comments on How to empty an array in JavaScript? Spread the love To empty an array in JavaScript, we set it to an empty array. For instance, we write let arr1 = ["a", "b", "c", "d", "e", "f"]; arr1 = []; to assign the arr1 array to an empty array to empty the array. Related Posts How to remove empty array values from an array with JavaScript?Sometimes, we want to remove empty array values from an array with JavaScript. In this… How to create an array of empty strings with JavaScript?Sometimes, we want to create an array of empty strings with JavaScript. In this article,… How to declare an empty two-dimensional array in JavaScript?Sometimes, we want to declare an empty two-dimensional array in JavaScript. In this article, we'll… By John Au-Yeung Web developer specializing in React, Vue, and front end development. View Archive → ← How to get all unique values in a JavaScript array? → How to add new array elements at the beginning of an array in JavaScript? Leave a Reply Cancel replyYour email address will not be published. Required fields are marked *Comment * Name * Email * Website Save my name, email, and website in this browser for the next time I comment. Current ye@r * Leave this field empty