我想从jQuery中的数组对象中删除双引号 由 funde发布于 2020-05-18 07:59:11 let pos = { lat: "33.5896138", lng: "73.3885526" }; 我有这样的数组,但我想从latLng值中删除双引号? 谁能帮我 谢谢
You can use the unary plus operator to transform the string numeric values to numbers:
希望有帮助!
use
parseFloat
You can find more information on parseFloat() MDN
为了将所有对象值更改为数字,可以使用以下表达式:
Now,
pos
is: