Open amatheus000 opened 4 years ago
Morning exercise
const firstTurtleWithHasInHisDescription = turtles.find (turtle => turtle.description.includes("has"))
const indexOfTheTurtleWhoseWeaponEndsWithI = turtles.findIndex(turtle => turtle.weapon.endsWith("i"))
Afternoon Work
We established an API and learned how to save data, and retrieve it and have it shown in the front end.
When editing text in an array we use: PATCH in combination with the fetch function
fetch(url, { method: "PATCH", headers: { 'Content-Type': 'application/json', 'Accept': 'application/json' }, body: JSON.stringify(body)} }
When Deleting an element in an array: fetch(url, { method: "DELETE", headers: { 'Content-Type': 'application/json', 'Accept': 'application/json' } })
Notes/Shortcuts:
When we want to show as checked element or just to leave it blank we can use the following code:
Morning exercise
const firstTurtleWithHasInHisDescription = turtles.find (turtle => turtle.description.includes("has"))
const indexOfTheTurtleWhoseWeaponEndsWithI = turtles.findIndex(turtle => turtle.weapon.endsWith("i"))
Afternoon Work
We established an API and learned how to save data, and retrieve it and have it shown in the front end.
When editing text in an array we use: PATCH in combination with the fetch function
fetch(url, { method: "PATCH", headers: { 'Content-Type': 'application/json', 'Accept': 'application/json' }, body: JSON.stringify(body)} }
When Deleting an element in an array: fetch(url, { method: "DELETE", headers: { 'Content-Type': 'application/json', 'Accept': 'application/json' } })
Notes/Shortcuts:
When we want to show as checked element or just to leave it blank we can use the following code: