352
parseInt(5) (lemmy.ml)
you are viewing a single comment's thread
view the rest of the comments
[-] victorz@lemmy.world 2 points 6 hours ago

The function expects a string and does things in the function body which converts the object into a string.

... These are different words that describe exactly what I'm saying. I'm saying: in the place where there should be a string argument, because the function expects one, there is not a string argument, but a number argument. (Not an object like you keep saying.)

I know all that stuff about dynamically typed languages. I'm just saying that the function is being used indirectly here.

[-] Traister101@lemmy.today 1 points 5 hours ago

You cannot have a string argument, arguments and variables in JS don't have a type. All you have in JS is objects. Actual functions, like full on function foo(){} are still objects, like you can actually store data on the things.

this post was submitted on 05 May 2025
352 points (98.6% liked)

Programmer Humor

23025 readers
1514 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS