lydiahallie / javascript-questions

A long list of (advanced) JavaScript questions, and their explanations :sparkles:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Variables

Louiswealthy opened this issue · comments

How do i differentiate variables ?

Can you explain a bit more what you mean by that? Assigning a value to a variable makes it differentiable from other values.

const a = 5
const b = 2
const sum = a + b

Is a simple example of that.

If you assign a value to a variable without quotes, it will be treated as a number.
example: let a = 11
And if you assign a value to a variable inside quotes, it will be treated as a string.
example: let b = "This is string"

Closing as this was answered above.