filmov
tv
Complex conditions in javascript

Показать описание
In this topic we discuss the and && or || or statement in Javascript.
Transcript:
good day guys and welcome to another
00:03
episode of JavaScript in this episode we
00:08
will be discussing complex conditions so
00:13
we will be going into depth into the and
00:17
and or factor and dealing in JavaScript
00:23
now it order for us to start let us go
00:27
into a very simple problem that it's
00:31
really simple let's just get started
00:33
there is no HTML and CSS in this
00:36
particular lecture so let's put variable
00:39
boy again is equal to 12 so your 12 boys
00:43
now we know this is an energy guy this
00:45
is not a string okay so it's not gonna
00:48
have the quotation marks variable girl
00:53
and maybe you can just put boys and
00:55
girls okay so we're gonna put equal to
00:58
212 perfect now so we're gonna do an if
01:04
statement if boys
01:23
now in this case we're gonna use the and
01:28
is the two kind of amber sound symbols
01:32
so this is what represents em in
01:35
JavaScript it boys equals to 12 and
01:39
girls note guys we're doing double equal
01:46
signs strict equality equals to 12 now
02:03
we're gonna put the string they are e
02:14
gonna end it off and I'm gonna put back
02:19
some curly brackets
02:21
so if boys equals to 12 and girls equal
02:24
to 12 put their equal
02:34
so we see that they're equal right
02:36
because both boys and girls equal 12
02:38
now if we want to put or if boys equal
02:43
to 12 or girls equal to 12
02:49
let's see what happens
02:54
being I think we put there equal to
02:57
right but what if we change this to 15
03:03
right so if boys equals 12 or good is
03:09
equal to 12 let's put an so we're gonna
03:11
go back to at the end sorry if boys
03:19
equal to 12 and girls equal to 12
03:23
document right they are equal to be
03:26
honest guys I don't think you'll run
03:27
because only one of them is equal to 12
03:31
nothing happens unless guys we put an
03:35
else statement so let's go here if boys
03:39
equal to 12 or girls equal to 12 we're
03:43
gonna put back the or statement which is
03:46
right above the enter key or bill is
03:49
equal 12 I think they may see something
03:51
because one of them is equal to 12 they
03:55
are equal now if we go back to the end
04:05
it's gonna put nothing unless we put an
04:09
else statement else doc you meant docked
04:18
right they are not equal really pretty
04:30
simple guys so let's see we even need a
04:35
quotation but let's put this right I'm
04:39
thinking it's gonna be an else statement
04:41
the else statement they're not gonna be
04:43
equal that's what I think they are not
04:45
equal do you know why because guys 12
04:50
and 15 are not equal but in my if
04:53
statement I put if boys equal to 12 and
04:56
girls I basically am saying that 12 I'm
05:00
basically saying that this is the case
05:02
if boys it's 12 and girls is 12 which is
05:06
the this is not the case right they are
05:08
are equal right they're not equal so
05:10
usually nothing would show but as I put
05:13
an else statement the else allows me to
05:15
put something in suit the code would not
05:17
run but by putting the else statement
05:19
it's along the cool to run right clearly
05:22
12 and 15 are not equal right
05:26
so if basically addressing that 12 and
05:28
15 are not equal right boys is 12 and
05:32
Bill's of 12 it's not evil so you can't
05:35
see they are equal right but we can see
05:38
they're not equal by putting the else
05:40
statement so guys this is basically
05:42
complex conditions this is the bedrock
05:46
of coding my friends follow what I'm
05:49
saying like comment and subscribe that's
05:53
again
Transcript:
good day guys and welcome to another
00:03
episode of JavaScript in this episode we
00:08
will be discussing complex conditions so
00:13
we will be going into depth into the and
00:17
and or factor and dealing in JavaScript
00:23
now it order for us to start let us go
00:27
into a very simple problem that it's
00:31
really simple let's just get started
00:33
there is no HTML and CSS in this
00:36
particular lecture so let's put variable
00:39
boy again is equal to 12 so your 12 boys
00:43
now we know this is an energy guy this
00:45
is not a string okay so it's not gonna
00:48
have the quotation marks variable girl
00:53
and maybe you can just put boys and
00:55
girls okay so we're gonna put equal to
00:58
212 perfect now so we're gonna do an if
01:04
statement if boys
01:23
now in this case we're gonna use the and
01:28
is the two kind of amber sound symbols
01:32
so this is what represents em in
01:35
JavaScript it boys equals to 12 and
01:39
girls note guys we're doing double equal
01:46
signs strict equality equals to 12 now
02:03
we're gonna put the string they are e
02:14
gonna end it off and I'm gonna put back
02:19
some curly brackets
02:21
so if boys equals to 12 and girls equal
02:24
to 12 put their equal
02:34
so we see that they're equal right
02:36
because both boys and girls equal 12
02:38
now if we want to put or if boys equal
02:43
to 12 or girls equal to 12
02:49
let's see what happens
02:54
being I think we put there equal to
02:57
right but what if we change this to 15
03:03
right so if boys equals 12 or good is
03:09
equal to 12 let's put an so we're gonna
03:11
go back to at the end sorry if boys
03:19
equal to 12 and girls equal to 12
03:23
document right they are equal to be
03:26
honest guys I don't think you'll run
03:27
because only one of them is equal to 12
03:31
nothing happens unless guys we put an
03:35
else statement so let's go here if boys
03:39
equal to 12 or girls equal to 12 we're
03:43
gonna put back the or statement which is
03:46
right above the enter key or bill is
03:49
equal 12 I think they may see something
03:51
because one of them is equal to 12 they
03:55
are equal now if we go back to the end
04:05
it's gonna put nothing unless we put an
04:09
else statement else doc you meant docked
04:18
right they are not equal really pretty
04:30
simple guys so let's see we even need a
04:35
quotation but let's put this right I'm
04:39
thinking it's gonna be an else statement
04:41
the else statement they're not gonna be
04:43
equal that's what I think they are not
04:45
equal do you know why because guys 12
04:50
and 15 are not equal but in my if
04:53
statement I put if boys equal to 12 and
04:56
girls I basically am saying that 12 I'm
05:00
basically saying that this is the case
05:02
if boys it's 12 and girls is 12 which is
05:06
the this is not the case right they are
05:08
are equal right they're not equal so
05:10
usually nothing would show but as I put
05:13
an else statement the else allows me to
05:15
put something in suit the code would not
05:17
run but by putting the else statement
05:19
it's along the cool to run right clearly
05:22
12 and 15 are not equal right
05:26
so if basically addressing that 12 and
05:28
15 are not equal right boys is 12 and
05:32
Bill's of 12 it's not evil so you can't
05:35
see they are equal right but we can see
05:38
they're not equal by putting the else
05:40
statement so guys this is basically
05:42
complex conditions this is the bedrock
05:46
of coding my friends follow what I'm
05:49
saying like comment and subscribe that's
05:53
again