FatherPhi video
How to Use Variables in JavaScript | Extreme JavaScript Basics
51 views ยท 9 likes ยท 1 comments
About this video
Vote for the next video here
๐๐๐
https://FatherPhi.com
Eleven labs is the crazy ai voice generation tool I use to fool ChatGPT
Try it out for free!๐ https://try.elevenlabs.io/6wbvspyzcq44
(Affiliate link)
For the weekly brief on accessible and practical Ai usage + updates on our latest mission join the newsletter
๐ https://master-of-ai.com
๐ฉ For business inquiries please reach out to phi@fatherphi.com
And since people are asking.
The camera I use to shoot these videos
๐น DJI Osmos Pocket 3 ๐ https://amzn.to/3O3Qw8R
Transcript
do you struggle with the concept of
variables in programming today I'm going
to share with you the most simple
explanation I could possibly think of to
explain variables in programming so stay
tuned
for this video we'll be using JavaScript
because javascript is really easy to run
in the browser we can use code sandbox
that IO I'm gonna provide I'm providing
the link in the description below it's
right under the subscribe button if you
want to click that and then go to the
code sandbox I'd really appreciate it if
you go to code sandbox that IO you'll be
able to type in the code that I give you
and actually run it and see how it works
so in JavaScript variables are actually
pretty magical I think it's a great
place to get started you don't really
you don't really have to think about all
the stuff underneath that magical layer
you're not thinking about computer or
anything it just things just kind of
happen so like snap the fingers and you
have a variable just like this so how do
we get this well in JavaScript there's a
it's like a magic word it's called let
and let here once we type it in this is
just a magic word that kind of like
creates a box you know and it's our
responsibility to name that box so if we
have a box with no name how do we name
it so in real life we would just write
the word like let's say Andrew on to it
alright well in JavaScript it's kind of
the same thing you just type let and
then Andrew but that's that's not all
and you can't stop there it will just be
an empty box if you'd like but let's try
to put something in the box so to put
something in the box we have to first
type we have to type out the length then
the name and then we use the equal sign
so what the equal sign we can put
whatever we want on the other side so
let's say we want to put the number 5
into the into this Andrew box well we
just type let
and drew equal five so we're basically
stuffing the five into that box and
we're naming it Andrew well is Andrew is
that name important
I mean it is if we want to call the box
and you know like if you want to recall
it somewhere else in the program but we
can that's really just the name I made
up I can change it to Ryan if I wanted
to does it have to be a number in the
variable no it doesn't have to be a
number you can put a word in there if
you if you want to but the word has to
be in quotes so let's change it to that
alright now we have let's say now we
have let Ryan equal boy so this will
this has a this is a essentially a box
with the word boy inside and if you want
to play around with this and like if you
don't think that this is correct you
know you can test it on so just go to
the link in the description click it and
it'll take you to the sandbox and just
type in let Ryan equal boy in quotes
then you type in alert parentheses right
oh you type in over parentheses Ryan and
this should pop up a little alert that
says whatever you put inside the box and
you can play around with it and now you
know how variables work
so this video helped you out today just
you know do me a favor and give me a
thumbs up or subscribe if it really
helps the YouTube algorithm if I get
those things and in addition to the
views I really appreciate the news but
liking and subscribing helped
tremendously so I'll see you next time
this is code phony out please
you
variables in programming today I'm going
to share with you the most simple
explanation I could possibly think of to
explain variables in programming so stay
tuned
for this video we'll be using JavaScript
because javascript is really easy to run
in the browser we can use code sandbox
that IO I'm gonna provide I'm providing
the link in the description below it's
right under the subscribe button if you
want to click that and then go to the
code sandbox I'd really appreciate it if
you go to code sandbox that IO you'll be
able to type in the code that I give you
and actually run it and see how it works
so in JavaScript variables are actually
pretty magical I think it's a great
place to get started you don't really
you don't really have to think about all
the stuff underneath that magical layer
you're not thinking about computer or
anything it just things just kind of
happen so like snap the fingers and you
have a variable just like this so how do
we get this well in JavaScript there's a
it's like a magic word it's called let
and let here once we type it in this is
just a magic word that kind of like
creates a box you know and it's our
responsibility to name that box so if we
have a box with no name how do we name
it so in real life we would just write
the word like let's say Andrew on to it
alright well in JavaScript it's kind of
the same thing you just type let and
then Andrew but that's that's not all
and you can't stop there it will just be
an empty box if you'd like but let's try
to put something in the box so to put
something in the box we have to first
type we have to type out the length then
the name and then we use the equal sign
so what the equal sign we can put
whatever we want on the other side so
let's say we want to put the number 5
into the into this Andrew box well we
just type let
and drew equal five so we're basically
stuffing the five into that box and
we're naming it Andrew well is Andrew is
that name important
I mean it is if we want to call the box
and you know like if you want to recall
it somewhere else in the program but we
can that's really just the name I made
up I can change it to Ryan if I wanted
to does it have to be a number in the
variable no it doesn't have to be a
number you can put a word in there if
you if you want to but the word has to
be in quotes so let's change it to that
alright now we have let's say now we
have let Ryan equal boy so this will
this has a this is a essentially a box
with the word boy inside and if you want
to play around with this and like if you
don't think that this is correct you
know you can test it on so just go to
the link in the description click it and
it'll take you to the sandbox and just
type in let Ryan equal boy in quotes
then you type in alert parentheses right
oh you type in over parentheses Ryan and
this should pop up a little alert that
says whatever you put inside the box and
you can play around with it and now you
know how variables work
so this video helped you out today just
you know do me a favor and give me a
thumbs up or subscribe if it really
helps the YouTube algorithm if I get
those things and in addition to the
views I really appreciate the news but
liking and subscribing helped
tremendously so I'll see you next time
this is code phony out please
you