Skip to content

Commit cf54c10

Browse files
authored
Merge pull request #277 from Benappiahpoku/patch-15
Update Question 391 & 396 README.md
2 parents 68624a0 + 312e71f commit cf54c10

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7076,7 +7076,7 @@
70767076
70777077
391. ### How do you use javascript libraries in typescript file
70787078
7079-
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,
7079+
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,
70807080
70817081
```javascript
70827082
declare var customLibrary;
@@ -7133,7 +7133,7 @@
71337133
71347134
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).
71357135
Whereas polyfill is a piece of code (or plugin) that provides the technology that you, the developer, expect the browser to provide natively.
7136-
In a simple sentence, A polyfill is a shim for a browser API.
7136+
In a simple sentence, a polyfill is a shim for a browser API.
71377137
71387138
**[⬆ Back to Top](#table-of-contents)**
71397139

0 commit comments

Comments
 (0)