0
How to eliminate string from the array
suppose you have a array that contain numbers and strings. write a function that skip tje strings from the array and sum up all the numbers in an array
6 Answers
+ 3
arr=[8,3,"hello",3];
sum=0;
arr.forEach(v=>
{ if(typeof v=="number")
{ sum+=v; }});
console.log(sum);
+ 1
bro make it little difficult. do it without built-in function
+ 1
i mean write function without any built in function. like donot use typeof function
+ 1
i mean donot use any built in function
0
JavaScript
0
thq dude