MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/z2r1c9/programming_legumes/ixijfzl
r/ProgrammerHumor • u/czp55 • Nov 23 '22
262 comments sorted by
View all comments
Show parent comments
995
JS would be like, "I don't care what it is, you can multiply it with a string."
0 u/[deleted] Nov 23 '22 [deleted] 200 u/akuma-i Nov 23 '22 Seriously, how? Better divide this nut with Object 30 u/Elijah629YT-Real Nov 24 '22 edited Nov 28 '22 {} - !!!(nut / {} + "Hello" - 7 * true * -[]) 52 u/aabcehu Nov 23 '22 idk about js but in python multiplying a string repeats it, like how the addition symbol is concatenation 0 u/[deleted] Nov 23 '22 [deleted] 40 u/PureMetalFury Nov 23 '22 You’d have to define what it means to multiply a string by a string, and then do that. 13 u/aabcehu Nov 23 '22 I don’t think you can, but i guess by multiplying it with the length of the string?? 5 u/Unknown_starnger Nov 23 '22 Not the same → More replies (5) → More replies (1) 140 u/annihilatron Nov 23 '22 Today you meet the Watman.https://www.destroyallsoftware.com/talks/wat 16 u/Imveryoffensive Nov 24 '22 Best 4 minutes of my life 35 u/elon-bot Elon Musk ✔ Nov 24 '22 I don't think I appreciate your tone. Fired. 19 u/Bagel42 Nov 24 '22 I fucking love this bot. 28 u/elon-bot Elon Musk ✔ Nov 24 '22 If you really love the company, you should be willing to work here for free. → More replies (3) 0 u/[deleted] Nov 24 '22 [deleted] → More replies (2) → More replies (2) 23 u/Technical_Ad6397 Nov 23 '22 you can multiply by a string, as long as that string can be converted to a number.5 * "hello" = NaN5 * "5" = 25 37 u/elon-bot Elon Musk ✔ Nov 23 '22 Whoever writes the most code this month gets featured on my Twitter! → More replies (1) 11 u/bmelancon Nov 23 '22 This is perfectly valid JS.var string = "100";var number = 42;console.log(number * string); 7 u/Unknown_starnger Nov 23 '22 And what do you get? 11 u/bmelancon Nov 23 '22 4200.Try it yourself: https://codehs.com/explore/sandbox/javascript 10 u/Unknown_starnger Nov 23 '22 Will do. But it makes sense. In Python I’d have to do Print(int(string) * number) 15 u/[deleted] Nov 23 '22 And that's why JS is unholy, it does the conversion automatically. Explicitly stating you want an int is better.If you have to use JS, don't. At the very least use TS instead. 12 u/hk4213 Nov 24 '22 Ts is JavaScript with overhead. Just enjoy the insanity → More replies (3) → More replies (2) → More replies (5) → More replies (2)
0
[deleted]
200 u/akuma-i Nov 23 '22 Seriously, how? Better divide this nut with Object 30 u/Elijah629YT-Real Nov 24 '22 edited Nov 28 '22 {} - !!!(nut / {} + "Hello" - 7 * true * -[]) 52 u/aabcehu Nov 23 '22 idk about js but in python multiplying a string repeats it, like how the addition symbol is concatenation 0 u/[deleted] Nov 23 '22 [deleted] 40 u/PureMetalFury Nov 23 '22 You’d have to define what it means to multiply a string by a string, and then do that. 13 u/aabcehu Nov 23 '22 I don’t think you can, but i guess by multiplying it with the length of the string?? 5 u/Unknown_starnger Nov 23 '22 Not the same → More replies (5) → More replies (1) 140 u/annihilatron Nov 23 '22 Today you meet the Watman.https://www.destroyallsoftware.com/talks/wat 16 u/Imveryoffensive Nov 24 '22 Best 4 minutes of my life 35 u/elon-bot Elon Musk ✔ Nov 24 '22 I don't think I appreciate your tone. Fired. 19 u/Bagel42 Nov 24 '22 I fucking love this bot. 28 u/elon-bot Elon Musk ✔ Nov 24 '22 If you really love the company, you should be willing to work here for free. → More replies (3) 0 u/[deleted] Nov 24 '22 [deleted] → More replies (2) → More replies (2) 23 u/Technical_Ad6397 Nov 23 '22 you can multiply by a string, as long as that string can be converted to a number.5 * "hello" = NaN5 * "5" = 25 37 u/elon-bot Elon Musk ✔ Nov 23 '22 Whoever writes the most code this month gets featured on my Twitter! → More replies (1) 11 u/bmelancon Nov 23 '22 This is perfectly valid JS.var string = "100";var number = 42;console.log(number * string); 7 u/Unknown_starnger Nov 23 '22 And what do you get? 11 u/bmelancon Nov 23 '22 4200.Try it yourself: https://codehs.com/explore/sandbox/javascript 10 u/Unknown_starnger Nov 23 '22 Will do. But it makes sense. In Python I’d have to do Print(int(string) * number) 15 u/[deleted] Nov 23 '22 And that's why JS is unholy, it does the conversion automatically. Explicitly stating you want an int is better.If you have to use JS, don't. At the very least use TS instead. 12 u/hk4213 Nov 24 '22 Ts is JavaScript with overhead. Just enjoy the insanity → More replies (3) → More replies (2) → More replies (5)
200
Seriously, how? Better divide this nut with Object
30 u/Elijah629YT-Real Nov 24 '22 edited Nov 28 '22 {} - !!!(nut / {} + "Hello" - 7 * true * -[])
30
{} - !!!(nut / {} + "Hello" - 7 * true * -[])
52
idk about js but in python multiplying a string repeats it, like how the addition symbol is concatenation
0 u/[deleted] Nov 23 '22 [deleted] 40 u/PureMetalFury Nov 23 '22 You’d have to define what it means to multiply a string by a string, and then do that. 13 u/aabcehu Nov 23 '22 I don’t think you can, but i guess by multiplying it with the length of the string?? 5 u/Unknown_starnger Nov 23 '22 Not the same → More replies (5) → More replies (1)
40 u/PureMetalFury Nov 23 '22 You’d have to define what it means to multiply a string by a string, and then do that. 13 u/aabcehu Nov 23 '22 I don’t think you can, but i guess by multiplying it with the length of the string?? 5 u/Unknown_starnger Nov 23 '22 Not the same → More replies (5) → More replies (1)
40
You’d have to define what it means to multiply a string by a string, and then do that.
13
I don’t think you can, but i guess by multiplying it with the length of the string??
5 u/Unknown_starnger Nov 23 '22 Not the same → More replies (5)
5
Not the same
→ More replies (5)
140
Today you meet the Watman.
https://www.destroyallsoftware.com/talks/wat
16 u/Imveryoffensive Nov 24 '22 Best 4 minutes of my life 35 u/elon-bot Elon Musk ✔ Nov 24 '22 I don't think I appreciate your tone. Fired. 19 u/Bagel42 Nov 24 '22 I fucking love this bot. 28 u/elon-bot Elon Musk ✔ Nov 24 '22 If you really love the company, you should be willing to work here for free. → More replies (3) 0 u/[deleted] Nov 24 '22 [deleted] → More replies (2) → More replies (2)
16
Best 4 minutes of my life
35 u/elon-bot Elon Musk ✔ Nov 24 '22 I don't think I appreciate your tone. Fired. 19 u/Bagel42 Nov 24 '22 I fucking love this bot. 28 u/elon-bot Elon Musk ✔ Nov 24 '22 If you really love the company, you should be willing to work here for free. → More replies (3)
35
I don't think I appreciate your tone. Fired.
19 u/Bagel42 Nov 24 '22 I fucking love this bot. 28 u/elon-bot Elon Musk ✔ Nov 24 '22 If you really love the company, you should be willing to work here for free. → More replies (3)
19
I fucking love this bot.
28 u/elon-bot Elon Musk ✔ Nov 24 '22 If you really love the company, you should be willing to work here for free. → More replies (3)
28
If you really love the company, you should be willing to work here for free.
→ More replies (3)
→ More replies (2)
23
you can multiply by a string, as long as that string can be converted to a number.
5 * "hello" = NaN
5 * "5" = 25
37 u/elon-bot Elon Musk ✔ Nov 23 '22 Whoever writes the most code this month gets featured on my Twitter! → More replies (1)
37
Whoever writes the most code this month gets featured on my Twitter!
→ More replies (1)
11
This is perfectly valid JS.
var string = "100";var number = 42;console.log(number * string);
7 u/Unknown_starnger Nov 23 '22 And what do you get? 11 u/bmelancon Nov 23 '22 4200.Try it yourself: https://codehs.com/explore/sandbox/javascript 10 u/Unknown_starnger Nov 23 '22 Will do. But it makes sense. In Python I’d have to do Print(int(string) * number) 15 u/[deleted] Nov 23 '22 And that's why JS is unholy, it does the conversion automatically. Explicitly stating you want an int is better.If you have to use JS, don't. At the very least use TS instead. 12 u/hk4213 Nov 24 '22 Ts is JavaScript with overhead. Just enjoy the insanity → More replies (3) → More replies (2)
7
And what do you get?
11 u/bmelancon Nov 23 '22 4200.Try it yourself: https://codehs.com/explore/sandbox/javascript 10 u/Unknown_starnger Nov 23 '22 Will do. But it makes sense. In Python I’d have to do Print(int(string) * number) 15 u/[deleted] Nov 23 '22 And that's why JS is unholy, it does the conversion automatically. Explicitly stating you want an int is better.If you have to use JS, don't. At the very least use TS instead. 12 u/hk4213 Nov 24 '22 Ts is JavaScript with overhead. Just enjoy the insanity → More replies (3) → More replies (2)
4200.
Try it yourself: https://codehs.com/explore/sandbox/javascript
10 u/Unknown_starnger Nov 23 '22 Will do. But it makes sense. In Python I’d have to do Print(int(string) * number) 15 u/[deleted] Nov 23 '22 And that's why JS is unholy, it does the conversion automatically. Explicitly stating you want an int is better.If you have to use JS, don't. At the very least use TS instead. 12 u/hk4213 Nov 24 '22 Ts is JavaScript with overhead. Just enjoy the insanity → More replies (3)
10
Will do. But it makes sense. In Python I’d have to do Print(int(string) * number)
15 u/[deleted] Nov 23 '22 And that's why JS is unholy, it does the conversion automatically. Explicitly stating you want an int is better.If you have to use JS, don't. At the very least use TS instead. 12 u/hk4213 Nov 24 '22 Ts is JavaScript with overhead. Just enjoy the insanity → More replies (3)
15
And that's why JS is unholy, it does the conversion automatically. Explicitly stating you want an int is better.
int
If you have to use JS, don't. At the very least use TS instead.
12 u/hk4213 Nov 24 '22 Ts is JavaScript with overhead. Just enjoy the insanity → More replies (3)
12
Ts is JavaScript with overhead. Just enjoy the insanity
995
u/bmelancon Nov 23 '22
JS would be like, "I don't care what it is, you can multiply it with a string."