SS
Size: a a a
SS
AN
const mockCallback = jest.fn();
там замоканная ф-яAN
SS
AN
AN
AN
SS
SS
SS
AN
SS
OJ
const inputValue = "[javascript] created:2016..2019 answers:1 -React -[angular] -[jquery] thisWordOnly"
function getSearchWords(inputValue) {
const words = inputValue.split(' ')
const skipRegex = /^-?\[.*\]$/gi // <-- не умею в регулярки
const necessaryWords = words.filter(word => {
const skip = !skipRegex.test(word)
return skip
})
return necessaryWords
}
console.log(getSearchWords(inputValue))
/*
[
'created:2016..2019',
'answers:1',
'-React',
'-[jquery]',
'thisWordOnly' <-- только это слово должно остаться
]
*/
AM
const inputValue = "[javascript] created:2016..2019 answers:1 -React -[angular] -[jquery] thisWordOnly"
function getSearchWords(inputValue) {
const words = inputValue.split(' ')
const skipRegex = /^-?\[.*\]$/gi // <-- не умею в регулярки
const necessaryWords = words.filter(word => {
const skip = !skipRegex.test(word)
return skip
})
return necessaryWords
}
console.log(getSearchWords(inputValue))
/*
[
'created:2016..2019',
'answers:1',
'-React',
'-[jquery]',
'thisWordOnly' <-- только это слово должно остаться
]
*/
SG
/thisWordOnly/
SG
AK
/thisWordOnly/
u
SG
SG