Created
May 13, 2018 09:02
-
-
Save gusenov/bd73efef41909b5a3d76af5b62bcd662 to your computer and use it in GitHub Desktop.
Обход свойств JavaScript-объекта.
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 myObject = { | |
"key_1": "value_1", | |
"key_2": "value_2", | |
"key_n": "value_n" | |
}; | |
for (var keyName in myObject) { | |
if (myObject.hasOwnProperty(keyName)) { | |
// Do something: | |
localStorage.setItem(keyName, myObject[keyName]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment