Uncaught ReferenceError: $ is not defined.
function isObject(item) {
return (typeof item === "object" && !Array.isArray(item) && item !== null);
}
fetch(url)
.then(responce => responce.json())
.then(console.log);
fetch(url)
.then(responce => responce.json())
.then(json => console.log(json.someKey));
синтаксис js - пустая трата времени.
Не понимаю, почему его вообще используют там, гдк без него можно обойтись
if (window.NodeList && !NodeList.prototype.forEach) {
NodeList.prototype.forEach = function (callback, thisArg) {
thisArg = thisArg || window;
for (var i = 0; i < this.length; i++) {
callback.call(thisArg, this[i], i, this);
}
};
}
var list = document.querySelectorAll('.hover');
Array.prototype.forEach.call(list, function (item) {
// do something
});