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

testing - Detect whether test has failed within fixture -

AbotX : How do you create a parallel crawler that stays on and can be added to at run time from new requests -

android - Create single AAR file from multiple modules using Gradle -