var b;
if(true) {
let a = b = 200;
}
console.log( typeof a ); // undefined
console.log( typeof b ); // number
if(true) {
let b;
let a = b = 200;
}
console.log( typeof a ); // undefined
console.log( typeof b ); // undefined
.portfolio__case {
transform: translateY(0px);
transition: transform ease .1s;
}
.portfolio__case:hover .portfolio__button {
display: block;
transform: translateY(-1px);
}
p = (+length + +width) * 2;
var p, s_house, s_masonry, total;
// Ширина дома
var width = parseInt($('#width-metr').val());
// Высота дома
var height = parseInt($('#height-metr').val());
// Длинна дома
var length = parseInt($('#length-metr').val());
// Площадь двери и окна
var s_wind_doors = parseInt($('#more-metr').val());
// Вычислить площадь
p = (length + width) * 2;
console.log('Периметр дома:', p);
var arr = [1,2,3,4,5]
function getSums(arr) {
let res = []
arr.reduce((sum, current) => {
res.push(sum+current)
return sum + current
},0)
return res
}
console.log(getSums(arr))
function countIdentic(arr) {
return arr
.sort()
.reduce((acc, n, i) => arr[i + 1] === n && arr[i - 1] !== n ? ++acc : acc, 0)
}
class Car {
constructor(model, color) {
this.model = model
this.color = color
this.passengers = []
}
sit(passengers) {
this.passengers = this.passengers.concat(passengers)
}
}
class People {
constructor(name, age) {
this.name = name
this.age = age
}
greet() {
alert(`Hello, I'm ${this.name}`)
}
}
const boomer = new Car('BMW', 'black')
const alex = new People('Alex', '26')
const vika = new People('Vika', '27')
boomer.sit([alex, vika])
boomer.passengers.forEach(function (passenger) {
passenger.greet()
})
<div class="container"></div>
<div class="title"></div>
<div class="project-preview">
<div class="project-preview__image"></div>
</div>
<div class="portfolio-section">
<div class="portfolio-section__inner">
<div class="portfolio-section__title"></div>
<div class="portfolio-section__grid">
<div class="portfolio-section__preview"></div>
<div class="portfolio-section__preview"></div>
<div class="portfolio-section__preview"></div>
...
</div>
</div>
</div>
<div class="portfolio-section">
<div class="portfolio-section__inner container">
<div class="portfolio-section__title title">Портфолио</div>
<div class="portfolio-section__grid">
<div class="portfolio-section__preview project-preview">
<div class="project-preview__image"></div>
</div>
<div class="portfolio-section__preview project-preview">
<div class="project-preview__image"></div>
</div>
<div class="portfolio-section__preview project-preview">
<div class="project-preview__image"></div>
</div>
<div class="portfolio-section__preview project-preview">
<div class="project-preview__image"></div>
</div>
</div>
</div>
</div>
function func() {
var a = 5;
var b = 10;
var sum = a + b;
}
var result = func()
console.log(result) // undefined
function func() {
var a = 5;
var b = 10;
var sum = a + b;
return 'I love js';
}
var result = func()
console.log(result) // 'I love js'
function func() {
var a = 5;
var b = 10;
var sum = a + b;
return sum;
}
var result = func()
console.log(result) // 15
function func(a, b) {
var sum = a + b;
return sum;
}
var result = func(3, 7)
console.log(result) // 10
function func(a, b) {
return a + b;
}
var result = func(2, 2)
console.log(result) // 4
function func1() {
return undefined;
}
var result = func1()
console.log(result) // undefined
function func2() {
}
var result = func2()
console.log(result) // undefined
function func() {
return function () {
return 'ааа сложнааа'
};
}
var result = func()
var result2 = result()
console.log(result) // function func()
console.log(result2) // 'ааа сложнааа'
console.log(func()()) // 'ааа сложнааа'
function func() {
for (var i = 1; i < 100; i = i + 1) {
return i
}
}
var result = func()
console.log(result) // 1
function func() {
for (var i = 1; i < 100; i = i + 1) {
}
return i
}
var result = func()
console.log(result) // 100
function func() {
for (var i = 1; i < 100; i = i + 1) {
}
return
}
var result = func()
console.log(result) // undefined
<a id="toTop">➤</a>
<meta http-equiv="imagetoolbar" content="no"><!-- disable image toolbar (if any) -->
<script type="text/javascript">
/*<![CDATA[*/
document.oncontextmenu = function() {
return false;
};
// ---удалить это---
document.onselectstart = function() {
if (event.srcElement.type != "text" && event.srcElement.type != "textarea" && event.srcElement.type != "password") {
return false;
}
else {
return true;
}
};
// -------
// ---и это---
if (window.sidebar) {
document.onmousedown = function(e) {
var obj = e.target;
if (obj.tagName.toUpperCase() == 'SELECT'
|| obj.tagName.toUpperCase() == "INPUT"
|| obj.tagName.toUpperCase() == "TEXTAREA"
|| obj.tagName.toUpperCase() == "PASSWORD") {
return true;
}
else {
return false;
}
};
}
// ------
document.ondragstart = function() {
return false;
};
/*]]>*/
</script>
var app = new Vue({
el: '#calculate',
data: {
dataFields: []
},
computed: {
totalPrice () {
return this.dataFields.reduce((acc, n) => {
return acc += n
}, 0)
}
}
});