-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Unable to run Array.map on an Array #8890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
TypeScript cannot contextually determine what the Something like: function getARPTable() {
return new Promise<any[]>((resolve, reject) => {
arp.table((error, devices) => {
if (error) reject(error);
else resolve(devices);
});
});
} |
@kitsonk Thanks! I created a similar interface to fix it. However, I am still not sure why does the error occur even after successful compilation to JavaScript and running under node? |
Because, instead of inferring type |
@kitsonk I didn't realise that the error was during compilation and not during runtime. Thanks for the clarification! 😄 |
TypeScript Version:
1.8
Code
Expected behavior:
No error output
Actual behavior:
error TS2339: Property 'map' does not exist on type '{}'.
The text was updated successfully, but these errors were encountered: