Size: a a a

2020 February 29

p

persona x grata in pro.js
Denis Efremov
function shuffle (word) {
 const array = word.split('')
 const last = array.splice(-1, 1)
 const [first, ...middle] = array
 return `${first}${middle.sort((a, b) => Math.random() - 0.5).join('')}${last}`
}
источник

p

persona x grata in pro.js
Дрксавипажт
источник

p

persona x grata in pro.js
Мне понятно, что это джаваскрипт
источник

R

Rellaxx in pro.js
А блин понял
источник

R

Rellaxx in pro.js
Всем спасибо
источник

p

persona x grata in pro.js
Rellaxx
function likes(names) {
 return {
   0: 'no one likes this',
   1: ${names[0]} likes this,
   2: ${names[0]} and ${names[1]} like this,
   3: ${names[0]}, ${names[1]} and ${names[2]} like this,
   4: ${names[0]}, ${names[1]} and ${names.length - 2} others like this,
 }[Math.min(4, names.length)]
}
Функция likes принимает пропс names

Скинь ссылку на кодварс
источник

R

Rellaxx in pro.js
гуглани
источник

R

Rellaxx in pro.js
первая будет
источник

t

th.witness in pro.js
источник

p

persona x grata in pro.js
Да, там косяк. Не знаешь почему? Если убрать value из хтмл. Тогда функция возвращает undefined
источник

t

th.witness in pro.js
persona x grata
Да, там косяк. Не знаешь почему? Если убрать value из хтмл. Тогда функция возвращает undefined
Ты используешь одно и то же значение для каждого клика.
источник

t

th.witness in pro.js
persona x grata
Да, там косяк. Не знаешь почему? Если убрать value из хтмл. Тогда функция возвращает undefined
const word = document.querySelector('input'); 
...
shuffle(input.value)
источник

p

persona x grata in pro.js
th.witness
const word = document.querySelector('input'); 
...
shuffle(input.value)
Unexpected token '.'
источник

t

th.witness in pro.js
persona x grata
Unexpected token '.'
Кек.
источник

t

th.witness in pro.js
persona x grata
Unexpected token '.'
источник

p

persona x grata in pro.js
Норм
источник

p

persona x grata in pro.js
Джаваскрипт круто
источник

p

persona x grata in pro.js
Denis Efremov
function shuffle (word) {
 const array = word.split('')
 const last = array.splice(-1, 1)
 const [first, ...middle] = array
 return `${first}${middle.sort((a, b) => Math.random() - 0.5).join('')}${last}`
}
Такой код считается за сеньера?
источник

DE

Denis Efremov in pro.js
persona x grata
Такой код считается за сеньера?
Сеньёрзный
источник

RU

Roman Usherenko in pro.js
Denis Efremov
function shuffle (word) {
 const array = word.split('')
 const last = array.splice(-1, 1)
 const [first, ...middle] = array
 return `${first}${middle.sort((a, b) => Math.random() - 0.5).join('')}${last}`
}
зачем эти танцы с бубном, если есть array.pop() и array.shift() ?
источник