Answer the question
In order to leave comments, you need to log in
At the moment, I call an array with 100 elements through the fetch method, how to write metho: Delete so that not the entire array is deleted, but only one?
const API_URL = ' https://jsonplaceholder.typicode.com/posts ';
let posts = []
const getPost = () => {
fetch(APi_URL)
.then((response) => response.json())
.then((json) => console.log(json));
}
getPost()
Answer the question
In order to leave comments, you need to log in
Deleting a resource
fetch(' https://jsonplaceholder.typicode.com/posts/1 ', {
method: 'DELETE',
});
From here: https://jsonplaceholder.typicode.com/guide/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question