There are many ways to remove an element from the JS array but if want to remove only a number in Array then you have to typeof and filter() methods.
Write a function to remove numbers from an Array javaScript
HTML example code.
<!DOCTYPE html>
<html>
<body>
<script>
function filter_list(l) {
return l.filter(x => typeof x === "string");
}
console.log(filter_list([1,2,'a','b']))
</script>
</body>
</html>
Output:
Do comment if you have any doubts or suggestions on this JS Array topic.
Note: The All JS Examples codes are tested on the Firefox browser and the Chrome browser.
OS: Windows 10
Code: HTML 5 Version