<button class="button-third">
<input type="text" class="input-third" />
X
</button>
document.querySelector(".button-third").addEventListener("click", (evt) => {
console.log("button click")
});
document.querySelector(".input-third").addEventListener("click", (evt) => {
evt.stopPropagation();
console.log("input click")
});
<script>
const LikeButton = e => {
e.target.classList.toggle('element-grid__like-button_active')
}
document.querySelector('.element-grid__like-button').addEventListener("click", LikeButton)
</script>
let guess = prompt();
let word = "cat";
let remain = word.length;
word.includes(guess) ? res.push(guess) : alert('no')
number = pressPower()() ** n;
function fourOperations(a, b){
return [a + b, a - b, a * b, a / b];
}
const test = fourOperations(10, 5);
console.log(test); // [15, 5, 50, 2]
const views = function(){
return this.age + this.name;
},
passport = {
age: 13,
name: 'name'
},
passport2 = {
age: 14,
name: 'name1'
};
console.log(views.call(passport));
console.log(views.call(passport2));
class Passport {
constructor(age, name) {
this.age = age;
this.name = name;
}
views() {
return this.age + this.name;
}
}
const passport1 = new Passport(14, "name1");
const passport2 = new Passport(12, "name2");
console.log(passport1.views())
console.log(passport2.views())
// Числовой тип
const typeNumber = 5;
// Строковый тип
const typeString = "Строка";
// Булевый тип
const typeBoolean = true
// Null
const typeNull = null;
// undefined
const typeUndefined = underfined;
// Symbol(новый тип в es6)
const typeSymbol = Symbol()