Skip to content

Returning a “typeof” value in a function?

I’m a total beginner, so it would be very helpful if someone posted the full solution in the comments. I’m trying to solve the following challenge on edabit: Create a function that takes an array and returns the types of values (data types) in a new array. So far I have this: But when I change &#8…

Property does not exist on type void

I am writing a hook to make a post request that returns two properties, sessionId and sessionData. I am using this hook in a component. My hook looks like this. And my component look like this When I try to access data.sessionData on the component I get the error that sessionDta does not exist on type void. B…

Why function is executed although await is used?

I have used await keyword in the main function to wait for the completion of async function call to poll() and yet the function call to my_plot is made before the completion of the poll() function. Code output: Expected: Answer Don’t use setTimeout directly from within an async function. Instead, use a …