Menu Home

var

osbo.com | JS | var

var declares a function scope variable.

Syntax

var name1 [= value1][, name2 [= value2]]...[, nameN [= valueN]];

Examples

Single Declare and Assign

Single Declare then Assign

Multiple Declare and Assign

Multiple Declare then Assign

Scope

Internal

const

let

External

Mozilla Developer Network