Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Is the property then void in typescript broken?


Asked by Makenna Todd on Dec 13, 2021 TypeScript



@BurningDog is right that this is a TypeScript types issue. Maybe you can get around it by doing (playPromise as any).then (function () { but the real fix is to figure out where your typings are broken.
In this manner,
TypeScript Data Type - Void Similar to languages like Java, void is used where there is no data. For example, if a function does not return any value then you can specify void as return type.
Subsequently, Problem "Property 'then' does not exist on type 'void'." with HTMLAudioElement · Issue #7374 · angular/angular-cli · GitHub 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.
Additionally,
TypeScript Private Properties Using TypeScript, we can add private functionality into our classes. What are private properties or methods? A private property of method can only be accessed or called from the class instance itself.
In addition,
If you come from traditional, strongly typed languages you might be familiar with the concept of void: A type telling you that functions and methods return nothing when called. void exists in both JavaScript as an operator and in TypeScript as a primitive type. And in both worlds void works a little bit different than most people are used to.