Variables in JavaScript

preview_player
Показать описание
---------------------
Get the scoop on how to identify and re-use values in JavaScript by using variables.
Рекомендации по теме
Комментарии
Автор

I have your book JavaScript Absolute Beginner's Guide - It is really GREAT. These videos are a perfect companion to it. Thank you

sharonseidl
Автор

One reason you can't start a variable name with a number is that there's a syntax for typing large/tiny numbers that looks like 45e10 or 23e-10, and it's more difficult to build an efficient grammar and parser for a language that would allow for those expressions to be either identifiers or number values.

krilnon
Автор

How do i activate a javascript in html button by clicking it like this kind of javascript:

if (9 > 4) {
confirm("Nine is bigger") }

else {
confirm("4 is bigger")
}

int_t
Автор

6:05 "you can't have a variable that starts with a number... don't ask me why... it's just how the world is."
Donkey: PICK ME! PICK ME!
because if they allowed that.. you could write a name just like you could write a number. (var 1 = "one")
sure they could've implemented it to ensure the variable name just isn't a number, by if it starts with 1, it must contain an alphabet/underscore... excluding the specific cases you use letters in numbers. but they obviously knew, it'd just be simpler, no loss to anybody, quicker to compile the page, etc... so it's no big deal to just use your numbers after the initial characters. lol

DlcEnergy