qodesmith / datepicker

Get a date with JavaScript! A datepicker with no dependencies.
344 stars 101 forks source link

Require vs import #102

Closed MehbubRashid closed 4 years ago

MehbubRashid commented 4 years ago

Hi,in the documentation it is said that either of import and require will work.Where should i use which one?

qodesmith commented 4 years ago

Typically, if you're using Node.js, you'll want to use require(...) since that's the syntax that Node.js uses. However, if you're writing modern ES6+ code and using something like Webpack to bundle your application code and dependencies, you probably want to use the import style.