if it's you created it with constant >> arr.splice(0, arr.length); if you created it with let >> A =[];