I wish to iterate over an object s properties and change them all to include ""
around the value stored in them.
This object is passed to a REST call and the above format must be enforced. I prefer to handle the addition of ""
in a central location, rather when assigning the actual values (the code is very complex and long).
我知道你可以轻而易举地通过物体属性循环:
$.each(queryOptions, function(obj){console.log(obj)})
然而,我能否以某种方式提及实际财产并将其设置在迭代中?
输入 :
queryOptions.value1 = 1234;
queryOptions.value2 = "testing";
queryOptions.value3 = 555;
希望产出:
queryOptions.value1 = "1234";
queryOptions.value2 = ""testing"";
queryOptions.value3 = "555";
谢谢 谢谢