KS
Size: a a a
KS
DS
М
S
DS
S
S
DS
М
j
c
j
М
DS
DS
НС
DS
j
{
const p = [1, 4, -2, 3]
const getK = () => 3
const multi = (k) => p.map(num => num * k)
const divide = (k) => p.map(num => num / k)
const show = (x) => console.log(x)
const onMultiply = () => show(multi(getK()))
const onDivide = () => show(divide(getK()))
document.getElementById('mul').addEventListener('click', onMultiply)
document.getElementById('divide').addEventListener('click', onDivide)
}
j
НС