let id = 1, name = 'test name', price = 100
const oldArr = [
{ id, name, price},
{ id, name, price},
{ id, name, price}
]
const newArr = oldArr.map(item => ({
code: item.id,
orderName: item.name,
orderPrice: item.price
}))
console.log(newArr)
new Date('2020-11-10T12:10:16.000000Z')
const date = new Date('2020-11-10T12:10:16.000000Z')
console.log(new Intl.DateTimeFormat('en-US').format(date)); // 11/10/2020
console.log(new Intl.DateTimeFormat('ru-RU').format(date)); // 10.11.2020
console.log(new Intl.DateTimeFormat(navigator.language).format(date)); // Зависимо от языка пользователя
[data-option-value$="из дуба"] {
background: yellow;
}
$('[data-option-value$="из дуба"]').css('outline', 'dashed 2px red');
undefined
можно заменить опционалыным модификатором ?
.function а (a?: number, b?: number) {}
type Sum = (a?: number, b?: number) => number;
interface ISum { (a?: number, b?: number): number; }
const sum: Sum = (a, b) => a + b;
RewriteEngine On
RewriteCond %{HTTPS} =off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [QSA,L]
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]