0
var count = 0;
var price = req.body.price + count;

In the above example I want the variable price to be equal to req.body.price0. How can I do that?

0

1 Answer 1

2

I think

var price = req.body['price' + count];

should do the job

See also here for more information about that

Sign up to request clarification or add additional context in comments.

1 Comment

Yup, this did it. Thank you very much.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.