query {
my_query {
scalar_field {
...someFields
}
}
}
query {
my_query {
scalar_field
}
}
const result = fetch();
const result2 = fetch();
Promise.all([result, result2]).then(values => {
console.log(values);
});
type
Чувствительная к регистру строка, представляющая тип прослушиваемого события.
['click', 'mouseover']. map(type => document.querySelector('.o').addEventListener(type, (event)=> {
console.log(event.type, document.querySelector('.o').textContent);
}))
const [value] = Directors.filter((arr)=>(arr.id === args.id));
return value;
return Directors.find((arr)=>(arr.id === args.id));
type Metric {
id: Int!
something: String
}
type Metric {
id: Int!
""" Боевая переменная """
something: String
""" Для тестов """
entities: Int
}
async function delay(n) {
setTimeout( () => (alert(n)), 2000)
}
function delay(n) {
return new Promise((resolve) => {
setTimeout( () => resolve(alert(n)), 2000)
});
}
window.addEventListener('load', () => {
setTimeout(function () {
preload.innerHTML = '<audio src="sounds/startsound.mp3" controls autoplay></audio>';
var audio = document.querySelector("audio");
audio.volume = 0.3;
preload.style.display = 'none';
}, 1000)
});
ERROR in Error: C:\Users\Aspire 3\Desktop\error-handling\src.ts\index.html:94
var canvas = document.getElementById('canvas');
^
ReferenceError: document is not defined
if(global.document){
....
}
// Import stylesheets
import "./style.css";
document.onkeydown = key;
function key() {
window.status = event.keyCode;
if (event.ctrlKey && (event.keyCode == 0xa || event.keyCode == 0xd)) {
// Если нажали ctrl+enter
// Кликаем по кнопке отправки сообщения
const { target } = event;
const { nodeName, name, value } = target;
console.log("event", target, nodeName);
if (nodeName === "TEXTAREA") {
console.log("Clicked textarea ", name, value);
}
}
}
// Write Javascript code!
const appDiv = document.getElementById("app");
appDiv.innerHTML = `<h1>JS Starter</h1>
<textarea name="tx1" ></textarea>
<textarea name="tx2" ></textarea>
<textarea name="tx3" ></textarea>
`;