Created
May 14, 2015 03:11
-
-
Save jaspervalero/a3dd4b16f9caf1d37dee to your computer and use it in GitHub Desktop.
let No Overwrite Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gamertag = 'TheAwesomeOne0110', // Set default gamer tag | |
gamers = [{ | |
gamertag: 'SomeGamer1', | |
email: '[email protected]' | |
}, { | |
gamertag: 'GrumpyTrollolol', | |
email: '[email protected]' | |
}]; | |
console.log( 'Before:', gamertag ); // TheAwesomeOne0110 | |
for ( let i = 0; i < gamers.length; i++ ) { | |
let gamertag = gamers[ i ].gamertag; | |
console.log( 'Gamertag:', gamertag ); | |
} | |
// Default gamer tag remains the same | |
console.log( 'After:', gamertag ); // TheAwesomeOne0110 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment