Skip to content

Instantly share code, notes, and snippets.

View coderunner's full-sized avatar

Felix Trepanier coderunner

View GitHub Profile
@coderunner
coderunner / promise.js
Created September 11, 2023 14:59
Promise - Async - Await
function fetchWithThenCatch() {
fetch("https://api.coinlore.net/api/tickers/")
.then((r) => r.json())
.then((json) => {
for (let i = 0; i < 3; i++) {
console.log('A - ', json.data[i].name);
}
})
.catch((error) => console.log("A - Erreur: ", error))
.finally(() => console.log("A - Finally"))
@coderunner
coderunner / question.js
Last active September 5, 2025 18:48
Question
function questionFetch() {
console.log("1");
fetch("https://jsonplaceholder.typicode.com/todos/1")
.then((response) => {
console.log("2");
return response.json();
})
.then((data) => {
console.log("3");
@coderunner
coderunner / spread.ts
Last active September 24, 2025 18:44
spread.ts
interface Address {
street: string,
postalCode: string
}
interface User {
name: string,
address: Address,
age: number
}