How to Solve cannot find module and its corresponding type declarations

How to Solve cannot find module and its corresponding type declarations

To solve cannot find module and its corresponding type declarations error in JavaScript, install that module and import the library in your program or file. For example, if you are working with react module, and you get an error like: “cannot find module ‘react’ and its corresponding type of declarations”, that means you forgot to install … Read more

How to Solve Uncaught ReferenceError: required is not defined

How to Solve Uncaught ReferenceError: required is not defined

To solve Uncaught ReferenceError: required is not defined in JavaScript, download the requireJS from its official website, put it on your script folder, and then include it via script tag on your HTML file. <!DOCTYPE html> <html> <head> <title>RequireJS on Browser</title> <script data-main=”scripts/main” src=”scripts/require.js”></script> </head> <body> <h1 id=”header”>This is body</h1> </body> </html> Here the data-main attribute … Read more

How to Convert String to Date in Javascript

How to Convert String to Date in Javascript

To convert string to date in JavaScript, use the date constructor or moment.js library. The Date() constructor creates a JavaScript Date instance that describes a single moment in time in a platform-independent format. We already saw an example of how to convert date to string. Let’s see two approaches to converting string to date. Using Date … Read more