Skip to content

Commit

Permalink
Merge pull request #277 from Benappiahpoku/patch-15
Browse files Browse the repository at this point in the history
Update Question 391 & 396 README.md
  • Loading branch information
sudheerj authored Jun 13, 2024
2 parents 68624a0 + 312e71f commit cf54c10
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7076,7 +7076,7 @@
391. ### How do you use javascript libraries in typescript file
It is known that not all JavaScript libraries or frameworks have TypeScript declaration files. But if you still want to use libraries or frameworks in our TypeScript files without getting compilation errors, the only solution is `declare` keyword along with a variable declaration. For example, let's imagine you have a library called `customLibrary` that doesn’t have a TypeScript declaration and have a namespace called `customLibrary` in the global namespace. You can use this library in typescript code as below,
It is known that not all JavaScript libraries or frameworks have TypeScript declaration files. But if you still want to use libraries or frameworks in your TypeScript files without getting compilation errors, the only solution is `declare` keyword along with a variable declaration. For example, let's imagine you have a library called `customLibrary` that doesn’t have a TypeScript declaration and have a namespace called `customLibrary` in the global namespace. You can use this library in typescript code as below,
```javascript
declare var customLibrary;
Expand Down Expand Up @@ -7133,7 +7133,7 @@
A shim is a library that brings a new API to an older environment, using only the means of that environment. It isn't necessarily restricted to a web application. For example, es5-shim.js is used to emulate ES5 features on older browsers (mainly pre IE9).
Whereas polyfill is a piece of code (or plugin) that provides the technology that you, the developer, expect the browser to provide natively.
In a simple sentence, A polyfill is a shim for a browser API.
In a simple sentence, a polyfill is a shim for a browser API.
**[⬆ Back to Top](#table-of-contents)**
Expand Down

0 comments on commit cf54c10

Please sign in to comment.