showing results for - "how to get only property names 2fkeys from a nested object"
Fanny
21 May 2018
1const person = {
2    name: 'labib',
3    age: 22,
4    job: 'web-developer',
5    frieds: ['ahsik', 'abir', 'alvi', 'hanafi'],
6    childList: {
7        firstChild: 'Salman',
8        secondChild: 'Rafi',
9        thirdChild: 'Anfi'
10    }
11}
12const getKeys = Object.keys(person); //use keys method on object
13console.log(getKeys)
14//Expected output:
15//[ 'name', 'age', 'job', 'frieds', 'childList' ]