json object length in javascript
snippet in javascript

json object length in javascript

user9745

const data = { a : 'b', c : 'd' };

const length = Object.keys(data).length;

//Length is 2