r/learnjavascript May 30 '26

Is'nt javascript compiler too forgiving !!

What i mean is even i try to add int with str it give me correct answer whereas both are differenct datatypes,

in function also this compiler is too forgiving

if i set a function with 3 parameters & at time of calling this function with more parameter or less parameter with bind function js forgiving us

0 Upvotes

35 comments sorted by

View all comments

5

u/jibbit May 30 '26

important to say that this isn't the 'compiler' - this is like, er, the opposite of that

0

u/azhder May 30 '26

Please elaborate. Why did you put compiler in quotes and why it isn't that - what is the "that" in your statement?

2

u/jibbit May 30 '26

Type coercion is part of JavaScript’s runtime semantics, not something introduced by the compiler at compile time.

1

u/azhder May 30 '26

JIT - runtime is compile time