Javascript sum += array

If you want to use parseInt make sure you completely understand all of its quirks — Ray Toal. Add a comment. Sorted by: Reset to default. Highest score default Trending recent votes count more Date modified newest first Date created oldest first. Ray Toal Ray Toal I guess parseFloat will? Do you want to accept that? Gui Imamura Gui Imamura 9 9 silver badges 26 26 bronze badges.

Javascript example

You are using concatination operation instead of arithmetic operator. ArunRaj ArunRaj 1, 2 2 gold badges 26 26 silver badges 48 48 bronze badges. Gokulakrishnan S Gokulakrishnan S 39 4 4 bronze badges. Kumpavat V. Kumpavat 41 1 1 silver badge 8 8 bronze badges. Kavya Hanumantharaju Kavya Hanumantharaju 4 4 bronze badges. You should stick to the variable names used in the question. Also a little bit of explanation would be more than welcome — Mike. A simple way of doing this. Hassan Khan Hassan Khan 97 6 6 bronze badges. Not the answer you're looking for? The Overflow Blog. How engineering teams at a large org can move at startup speed sponsored post. The fine line between product and engineering Ep. Moderation strike: Results of negotiations.

Example 1: Add Two Numbers

Temporary policy: Generative AI e. Linked 0. See more linked questions. Related Math Object. Learning Paths. Interactive C Course. Interactive Java Course. More languages. Add Two Numbers. Calculate the Area of a Triangle.

Js add two numbers

Convert Celsius to Fahrenheit. Share on:. Did you find this article helpful? Sorry about that. How can we improve it? Leave this field blank.