Category – JavaScript
2 posts tagged with "JavaScript" (See all categories)

JJavaScript returns undefined if curly brace is on next line

08/28/20181 Min Read — In JavaScript

Semicolons are optional in JavaScript. If you do not open a brace or add your return object to the same line as the return statement, JavaScript will interpret this as desiring to return undefined. This behavior trips up a lot of developers coming from languages where the standard is to add the…

JJavascript var vs let

07/17/20161 Min Read — In JavaScript

You’ve seen let and var used and for the most part they appear to be interchangeable but what exactly is the difference between let and var? The simplest explanation of the difference between let and var is that let is bound by block scope while var is bound by function scope. Consider the following…