3 ms·
Javascript has type errors too, and Java will let you 'add' a string to an integer, so it's more nuanced than that... Javascript: > null.bob() Ty
by kybernetikos 7y ago
Javascript has type errors too, and Java will let you 'add' a string to an integer, so it's more nuanced than that...
Javascript:
> null.bob()
TypeError: Cannot read property 'bob' of null
> 4 >>> Symbol("four")
TypeError: Cannot convert a Symbol value to a number
> BigInt(null)
TypeError: Cannot convert null to a BigInt
> Object.create(false)
TypeError: Object prototype may only be an Object or null: false
Java:
int anInteger = 10;
String s = anInteger + "Hello";