javascript - Object length in typescript? -
this question has answer here:
- length of javascript object 30 answers
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
Post a Comment