Difference between const <modulename> and var <modulename>



Hi. I’ve just started out with NativeScript and gone through Playground tutorial. I have a question. What’s the difference in including a module in js file in following two ways?

const frameModule = require("ui/frame");
var observableModule = require("data/observable");

i.e. using const vs var. I’ve used both of them being used in the tutorial.


It’s covered in the basics of ES6.


I know the difference between const and var. I’m asking what are the repercussions of using them for modules? How do they apply to modules?