javascript - Object length in typescript? -


this question has answer here:

is there way in typescript can length of object:

something this:

say have object:

public customer:any={      "name":"bhushan",      "eid":"879546",      "dept":"it" } 

now trying length in typescript.

ie. when doing customer.length(), should able value 3 has 3 elements.

i tried object.getownpropertynames(customer.value) returning 2 whereas have 3 elements in object.

any inputs?

you try following:

object.keys(customer).length 

Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -