// запрещенные слова
array = ["ыва", "файл", "уй", "иг_Л"]
// регулярное выражение
blacklist = new RegExp(array.join("|"), 'gi')
text = /* содержимое прочитанного файла */
blacklist.test(text)
// true если найдено, false если нет
// MainBlock
handleClick = () => {
this.props.setActive(props.data.id)
}
// в class FAQ
setActive = id => { this.setState({ activeId: id }) }
...
{faqList.map( data =>
<MainBlock data={data} active={data.id === this.state.activeId} setActive={this.setActive} />
)}
pokemons.pokemonList.map((pokemon, index) => {
.....
const [pokemon, setPokemon] = useState({..
// одинаковое имя переменной pokemon
})
let observer = new MutationObserver(function(mutationsList, observer) {
for (let mutation of mutationsList) {
// if (mutation.type === 'childList') { .....
console.log(mutation.addedNodes)
console.log(mutation.addedNodes[0].textContent)
}
});
Если кто-то подскажет, как сделать, чтоб скролл внутри блока был всегда внизу - буду премного благодарен
$('.viewer').append(....)
obs.scrollTop = obs.scrollHeight
<span id="cifri2">df</span>
......
cifri2 += ", " + i;
url.replace(/&#(.*?);/g, (match, g1) => String.fromCodePoint(g1))
this.users.find(user => user.first === first && user.last === last)
// user || undefined
form.addEventListener('submit', function(evt) {
evt.preventDefault();
// ничего не делаем
if (document.querySelector('#hidden').value) return
let formData = {
name: document.querySelector('input[name="name"]').value,
phone: document.querySelector('input[name="phone"]').value,
email: document.querySelector('input[name="email"]').value,
textarea: document.querySelector('textarea[name="textarea"]').value,
};
var request = new XMLHttpRequest();