Why can I do this in Dart but not in JS

PHOTO EMBED

Sun Jun 20 2021 07:26:48 GMT+0000 (UTC)

Saved by @jmo ##dart ##js

//Dart: can multiply string with number
print('x' * 5) // 'xxxxx';

//JS: cannot multiply string with number
console.log('x' * 5) // NaN;
content_copyCOPY