国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

javascript - what does if(aa) mean
黃舟
黃舟 2017-07-05 10:52:09
0
5
1512


if(aa) What exactly is it judging? (I was looking at other people’s code screenshots with these judgments. I didn’t understand the abbreviation)
Is it to judge whether aa is null or undefined??

Let’s assume Figure 2:

What is the if(aa) here judging??

黃舟
黃舟

人生最曼妙的風(fēng)景,竟是內(nèi)心的淡定與從容!

reply all(5)
漂亮男人

First of all, the syntax of if expression is:

if (expression)
    statement

expressionexpression is executed. If the result is truthy (true value), statement is executed. If it is falsy (false value), it is not executed.

truthy and falsy in JavaScript. The false value is

false
undefined
null
0
-0
NaN
"" // the empty string

Except for these, the rest are true values.

我想大聲告訴你

Please search for keywords yourself: Implicit type conversion

洪濤

If you don’t understand, you can ask questions

過去多啦不再A夢

This is an if judgment expression. The specific syntax is as follows:

if (condition)
   statement1
[else
   statement2]

The value in condition needs to be of Boolean type true or false

In Javascript, the following values ??will be implicitly converted to false:
0, -0, null, false, NaN, undefined, "" (empty string)
Other values ??will be converted to true, please note that "false "It's also true.

迷茫

if (aa) is equivalent to

if (!!aa){
    console.log('here goes true'); 
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template