I am currently working with an AngularJS controller and I am following the guidelines set by John Papa when it comes to binding variables at the top. My question is: does initializing variables with default values during declaration offer any performance advantages, or does it have a negative impact on performance?
function someCtrl($scope) {
var vm = this;
vm.someVar = ''; // Should it rather be vm.someVar; ?
}
While my question pertains to AngularJS, it can also be considered as a general JavaScript query.
UPDATE: In another scenario, what if we do the following:
function someCtrl($scope) {
var someVar = ''; // Should it rather be var someVar; ?
}