How can I change the key name in an array of objects?
var arrayObj = [{key1:'value1', key2:'value2'},{key1:'value1', key2:'value2'}];
How can I change each key1
to stroke
so that I get:
var arrayObj = [{stroke:'value1', key2:'value2'},{stroke:'value1', key2:'value2'}];
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…