Comment

Comment by Skalman

Perhaps you didn't catch that basically the difference between let and var is that let is block-scoped, while var is function-scoped?

  let result = 0;
  for (let i = 0; i < arr.length; i++) {
    result += arr[i];
  }
parent Skalman 11 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton