Created
March 28, 2019 02:33
-
-
Save deleteman/43f88992735df57ca42154810f1466cf to your computer and use it in GitHub Desktop.
Iterating over an object's properties
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
| class Obj { | |
| constructor() { | |
| this.a = 1 | |
| this.b = 1 | |
| this.c = 1 | |
| } | |
| method(st){ | |
| } | |
| } | |
| let obj = new Obj() | |
| for(m in obj) { | |
| console.log(m) | |
| } | |
| console.log(Object.keys(obj)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment