Created
February 6, 2022 07:42
-
-
Save jedsada-gh/8a161a43992f9c1ee4df67212f7678af to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from "axios"; | |
(async () => { | |
const req = axios.create({ baseURL: "https://jsonplaceholder.typicode.com" }); | |
const json = (await req.get("/todos")).data | |
const newItems = [] | |
for(let i = 0; i < json.length; i++) { | |
if (json[i].completed === false) { | |
newItems.push(json[i]) | |
} | |
} | |
console.log("newItems: ", json.length - newItems.length) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment