Dave's Brain

Browse - Programming Tips - How do I iterate though the result of a split?

Date: 2014aug12
Language: javaScript
Level: beginner
Keywords: enumerate

Q.  How do I iterate though the result of a split?

A.  Like this:

var a = str.split(/:/); for (var i = 0; i < a.length; i++) { console.log(a[i]); }

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.