logo
Search
showing results for - "javascript remove junk element from array"
Charlette
24 Sep 2018
1let myArray = ["user1","user2", "", ""]
2console.log(myArray)
3
4function cleanArray(_array) {
5  for (i in _array){
6    if(_array[i] == ''){
7      _array.splice(i, 1)
8    }
9  }
10  return _array
11}
12
13console.log(cleanArray(cleanArray(myArray)))
similar questions
javascript remove all the common value from arrayjs array delete specific elementhow to remove a specific element from array in javascriptremoving element at index without changing the original arrayjs delete all array itemssplice remove 0 elements before index and insert new elementhow to pop more then one element jsjavascript remove one element from arrayhow to delete an item from an array from adeleting a value in a table javascriptjavascript to remove few items from arrayjs remove speific item from arrayhow to remove sub array null index in javascriptarray remove empty entrys jsnodejs remove element from arrayremove empty values from array javascriptjavascript array remove middlehow do you remove a remove element from array in javascriptcomo remover un elemento de un arrayjavascript remove empty elements from array
queries leading to this page
javascript remove junk element from arrayjavascript remove junk element from array
privacy policyterms of useinstagram
Crafted with  ♥  for everyone

sign in to continue
your answer for
you will get a confirmation link on this - you will have to click that for successful submission of your answer. we require this to keep the website free of spam, bots and unhelpful content
please ensure to add code which is syntactically corrent and executes properly
sign in to continue
ask question on maxinterview
you will get a confirmation link on this - you will have to click that for successful submission of your question. we require this to keep the website free of spam, bots and unhelpful content
please be clear, to the point and respectful
sign in to continue