Answer the question
In order to leave comments, you need to log in
How to make numbers remain without quotes?
Hello. Do not get angry)
There is such a pen
as a result, the data from the forms goes to the json format
{
"ItemToOrders": [{
"Qty": "1",
"FrameStyle": "2"
}],
"cotact": {
"city": "уу",
"country": "уу"
}
}
{
"ItemToOrders": [{
"Qty": 1,
"FrameStyle": 2
}],
"cotact": {
"city": "уу",
"country": "уу"
}
}
Answer the question
In order to leave comments, you need to log in
You can use a regular:
const regex = /"(\d+)"/g;
const subst = `$1`;
const result = foo.replace(regex, subst);
console.log(result);
in a loop through the ItemToOrders array, bring its values to a number
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question