LeetCode #27 Remove Element
var removeElement = function(nums, val) { while(nums.includes(val)) { let index = nums.indexOf(val); nums.splice(index, 1); } console.log(nums) };