javascript how to remove every 3rd element from an array -


How do I remove every 3 elements from an array?

  var TheArray = ['How can I make it without creating one without saying "Hello"? New array?   

Try this:

 for  (var i = 2; I & lt; = TheArray.length; i + = 2) TheArray.splice (i, 1);   

If you want a string at the end, then just use TheArray.join ("") .

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

jsp - Google line chart x-axis shrinks on transition -

java - Reaching JTextField in a DocumentListener -