Whats with all these Variables…

Let’s talk a little bit about variables for second. In JavaScript there are a few things that one needs to know about the use of Variables.

Basics of JavaScript

Variables can be one of 5 different categories:

String = Literally a sentence or text. To identify a string you encase the text in single or double quotes: Example(“thanks for playing”;)

Number = Literally numbers. To identify a number quotes are not needed: Example(insert any number here; :))

Boolean = Literally a true/false statement. You do not need to identify a boolean with quotes: Example(let variableName = true;)

Array = Literally a list. You identify an array by encasing the values inside [] Example( let variableName = [1, 2, “book”, “carrot”];)

Object = Literally anything. Everything in JavaScript is an object and can be stored in a variable: Example( let variableName = document.querySelector(‘h1’); As a point of reference all previous examples are objects. )

Thanks for taking the time in reading about some info on Variables and JavaScript. I’d love to get your feedback on what you’d like to hear about in the future so leave a comment if you will and I’ll do my best to put something together.

Cheers and Stay tuned for more snippets on programming and such.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Seth Starr

Passionate coder, video game enthusiast, and hospitality professional.