100 Days Of Javascript

Javascript Loop

Day Two – Loops

Took a look at the for and for / in loops and how they’re used in variables and objects to pull information.

var warGoodForObject = {
"what": "nothing",
"who": "no one"
for( var name in warGoodForObject ) {
console.log ( name + ": " + warGoodForObject[name] );

Results in console:
what: nothing
who: no one

By Joseph Dickson

Joseph Dickson is a web developer in higher education and an avid proponent of using WordPress’ core features to create flexible and manageable design solutions.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.