В-
Size: a a a
В-
В
В-
IK
AB
В
В
vd
В-
vd
В-
j
const str = 'aaa.bbb.ccc.ddd.eee.fff.ggg'
const result = []
let index = -1
while ((index = str.indexOf('.', index + 1)) >= 0) {
result.push(str.slice(0, index) + str.slice(index + 1))
}
О
YM
j
const ids = ['a', 'b', 'c', 'd']
const result = ids.reduce((acc, id) => {
const value = document.getElementById(id).value
return value ? Number(value) + acc : acc
}, 0)
j
const ids = ['a', 'b', 'c', 'd']
let result = 0
for (const id of ids) {
const value = document.getElementById(id).value
if (value) {
result += Number(value)
}
}
j
getValue(id)
const result = (getValue('a') + getValue('b')) * getValue('c')
j
j