I made a simple function to illustrate my problem
I ran this code on Windows Powershell with Node.js, not on a browser. It doesn't log anything to the console. What am I doing wrong? I was just goofing around testing stuff. This is the only code in the file, nothing else.
var sigma = function(nums) {
var i = 0;
var ops = nums.length - 1;
var sum = 0;
while (i <= ops) {
sum += nums[i];
i += 1;
}
console.log(sum);
};
sigma([1, 2, 3, 4, 5]);