Created
June 15, 2022 12:51
-
-
Save Octagon-simon/defc693d9832896a1ba2455c436f6418 to your computer and use it in GitHub Desktop.
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
| const profile = { | |
| name : "Simon", | |
| email: "me@you.com", | |
| gender : "male" | |
| } | |
| let i = 0; | |
| //get the length of the object | |
| while( i < Object.keys(profile).length ){ | |
| //since we hold the current index, retrieve the key and value assigned to it | |
| console.log( Object.keys(profile)[i]+' = '+Object.values(profile)[i] ); | |
| i++; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment