function Stack() {
this._size = 0;
this._storage = {};
}
Stack.prototype.push = function(data) {
var size = ++this._size;
this._storage[size] = data;
};
Stack.prototype.pop = function() {
var size = this._size,
deletedData;
if (size) {
deletedData = this._storage[size];
delete this._storage[size];
this._size--;
return deletedData;
}
};
class Stack {
constructor() {
this.stack = []
}
// Inserts the element into the top of the stack
push(element) {
this.stack.push(element)
}
// Removes the element from the top of the stack and return that element
pop() {
if (this.isEmpty()) return 'Stack is empty!'
return this.stack.pop()
}
// Return which element is on top of the stack
peek() {
if (this.isEmpty()) return 'Stack is empty'
return this.stack[this.stack.length - 1]
}
// helper method
isEmpty() {
return !this.stack.length
}
}
так заказчик все-равно выбирает самого первого исполнителя, у которого 1000 отзывов и работ)
Преждевременная оптимизация - корень всех зол.
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.2
document - текущий документ
getElementById() - метод получения элемента используя id
onchange - свойство элемента для обработчика события
function (event){} - анонимная функция (обработчик события)
event - локальная переменная в контексте анонимной функции
target - таргет он и в африке таргет (целевой элемент, где происходит туса)
parentNode - родительская нода
childNodes[1] - у родителя есть дети
data - у детей есть данные
slice(1) - отхренашить кусочек
currentKey - отхренашеный кусочек