Skip to content
Advertisement

Tag: json

javascript: how to get all ids of a json array with for loop

I’m having a problem getting the different ids from my json object. I get are the id of the last item. This is the function: This is the json array I get: Thanks to all in advance Answer The concrete error in your code was this line: It needs a “+” before the “=” to add more strings/ids to the

Uncaught in promise while waiting for json response

I’m implementing Promises for the first time in JS and am getting uncaught in promise exception in console log while running the below code. I am handling the result of the promise return value in the main function as below and am yet getting the uncaught in promise message: The logic behind the data_present() is to wait till we get

TypeError: Router.use() requires a middleware function but got a string at Function.use

I’m new to Node and ExpressJs development, however, I cannot import a module router created by me as an exercise. It gives me this error: I have already tried the module.exports solution, but it doesn’t work. The initialize function also fails. Here are the versions I am working with: Node version: v10.19.0 Express version: 4.17.2 Index.js ProgettoRouting.js Answer You need

can’t fetch msgraph data using vanilla js

I am trying to pull data from the endpoint https://graph.microsoft.com/v1.0/me/. I have done this using python but I can’t seem to fetch data from Microsoft Graph using vanilla js. When I attempt to perform a fetch request. I get a 200 response but nothing is inside the response object. Here is the fetch code: I get a response of: but

Advertisement