Home:ALL Converter>Is there a reason for using var instead of const in Gulp config files?

Is there a reason for using var instead of const in Gulp config files?

Ask Time:2018-09-21T18:02:24         Author:user6329530

Json Formatter

According to the answers to this question Const in JavaScript: when to use it and is it necessary? it would make sense to use const for gulpfile.js configuration, would it not?

But in every usage description of gulp-modules, I see var being used like for instance:

var gulp = require('gulp');
var argv = require('yargs').argv;

var autoprefixer = require('gulp-autoprefixer');

//...

As I understand it, these declarations never change while Gulp is running.

Is there a reason for using var? Is it something with node.js compiler? Or is this just a habit?

Author:user6329530,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/52441260/is-there-a-reason-for-using-var-instead-of-const-in-gulp-config-files
yy