reset a list javaScript code example Example 1: how to clear array in javascript A.length = 0 Example 2: js delete all array items A.length = 0