hash.split("/")
titles = ['title one', 'title two', 'title three']
searcheable.innerHTML = `<ul>
${ titles.map( t => `<li>${t}</li>` ).join('') }
</ul>`
/*
<ul>
<li>title one</li><li>title two</li><li>title three</li>
</ul>
*/
import React, { useEffect } from 'react';
export default function GetContent() {
const GetData = () => {
...
};
useEffect(() => {
GetData().then(res => console.log(res));
}, []);
return (
<div>
</div>
)
} (s => `${s.substr(0,2)}.${s.substr(2,2)}.${s.substr(4)}`)('30032020')const format = (_, v) => {
const s = v.toString();
return `${s.substr(0,2)}.${s.substr(2,2)}.${s.substr(4)}`;
}
format`${30032020}`const num = 30032020; // число
const str = num.toString().padStart(8, '0'); // строка длиной 8 символов
const result = `${str.substr(0,2)}.${str.substr(2,2)}.${str.substr(4)}`; // "30.03.2020"requestAnimationFrame(), реже срабатывают таймеры.
year == 2015 ? alert('правильно') : alert('не правильно');
year == 2016 ? alert('правильно') : alert('не правильно');year == 2015 || year == 2016 ? alert('правильно') : alert('не правильно'); ||const year = prompt('В каком году появилась спецификация ECMAScript-2015?');
alert( year == '2015' || year == '2016' ? 'правильно' : 'неправильно' );
array.reduce((accumulator, value, index) => {
if (!(accumulator[index % 2] instanceof Array)) {
accumulator[index % 2] = [];
}
accumulator[index % 2].push(value);
return accumulator;
}, []);array.reduce((accumulator, value, index) => {
accumulator[index % 2].push(value);
return accumulator;
}, [[], []]);array.reduce((accumulator, value, index) => (accumulator[index % 2].push(value), accumulator), [[], []]);array.reduce((a, v, i) => (a[i % 2].push(v), a), [[], []]);const countOff = (array, count) => array.reduce((accumulator, value, index) => {
accumulator[index % count].push(value);
return accumulator;
}, Array.from({ length: count }, () => []));
countOff([1, 2, 3, 4, 5, 6], 2); // [[1, 3, 5], [2, 4, 6]]
countOff([1, 2, 3, 4, 5, 6], 3); // [[1, 4], [2, 5], [3, 6]] Возможна ли отправка уведомления о новом письме в мессенджере в бота телеграмм,
если это возможно то можно ли привязать к этому действию несколько аккаунтов фб на 1 обработчик хука?