2021年3月24日星期三

How do I iterate over properties of an array (not the elements) in javascript?

If I have an array

let ar = ['a', 'b', 'c'];  ar.prop1 = 'Hello';  ar.prop2 = 'world';  

How do I iterate over just the properties (prop1 and prop2) in this case?

https://stackoverflow.com/questions/66791070/how-do-i-iterate-over-properties-of-an-array-not-the-elements-in-javascript March 25, 2021 at 07:50AM

没有评论:

发表评论