if (a > b) console.log("a win");
if (a > b) {
console.log("b lost");
console.log("a won");
}
То же с for ()
, да и с просто-кодом.class
или литералом объекта.function
, а затем про круглые скобки ) const url ='https://images.unsplash.com/photo-1599009434802-ca1dd09895e7';
const img = new Image();
img.onload = function() {
console.log('loaded!');
someElement.appendChild(img); // вставить куда-то
}
img.src = url;
Traditionally, and according to ECMAScript, all primitives and objects are loosely unequal to undefined and null