About 597,000 results
Open links in new tab
  1. javascript - Adding two numbers concatenates them instead of ...

    Jan 24, 2013 · You need to use javaScript's parseInt() method to turn the strings back into numbers. Right now they are strings so adding two strings concatenates them, which is why …

  2. Everyone says JS is weird with strings and numbers. Meanwhile, C: - Reddit

    Oct 27, 2022 · It's not joining strings, it's just adding numbers and displaying them since ' is for a single char (so just a 1 byte number) and " is for a char array aka string (or const char*). It …

  3. GitHub - denysdovhan/wtfjs: A list of funny and tricky JavaScript ...

    The unary plus operator attempts to convert its value into a number. It can convert string representations of integers and floats, as well as the non-string values true, false, and null. If it …

  4. JavaScript Behavior While Adding Strings and Numbers: - Medium

    Apr 1, 2021 · You can add numbers, and can concatenate strings and many more. But what would happen if you want to add a Number and a String. Look deeply at the the following code:

  5. How does adding String with Integer work in JavaScript?

    Nov 29, 2016 · In JavaScript, the + operator is used for both numeric addition and string concatenation. When you "add" a number to a string the interpreter converts your number to a …

  6. i saw this on google and Can someone explain some of these in

    Mar 6, 2023 · Plus in javascript is shorthand for string concatenation if you don't have numbers on both sides. You can use it with strings, numbers, or arrays, and they all get converted to …

  7. 20 of best jokes on JavaScript - Altcademy Blog

    May 3, 2023 · 13. The parseInt() joke. The parseInt() function in JavaScript is used to parse a string and return an integer. However, it can sometimes produce unexpected results: Why did …

  8. Funny JavaScript, It'll make you Laugh and Cry - DEV Community

    Jun 9, 2024 · Lets start with something that most of you would mostly know, the infamous joke in JS. The first part "B"+"a" will be a string concatenation. the magically part would be + + 'a', …

  9. How to add two strings as if they were numbers? [duplicate]

    convert the strings to floats with parseFloat(string) or to integers with parseInt(string)

  10. 200+ JavaScript Puns That Will Keep Your Humor Running …

    Apr 30, 2025 · JavaScript puns and jokes are a delightful way to lighten your day! With over 200 clever quips, you’ll never run out of laughs. These jokes not only entertain but also showcase …

    Missing:

    • Integers

    Must include:

Refresh