gpt4 book ai didi

javascript - 有人可以帮我解释一下这个返回声明吗?

转载 作者:行者123 更新时间:2023-11-28 11:10:21 24 4
gpt4 key购买 nike

我有一个在 this Stackover answer 中使用的 return 语句,我不太明白。这是:

return maxWidth > $this.width() || maxHeight > $this.height();

以某种方式返回某物是什么意思?

一旦我知道问题是什么,我将在回答后编辑该问题的标题:)

最佳答案

这相当于:

if (maxWidth > $this.width() || maxHeight > $this.height()) {
return true;
} else {
return false;
}

换句话说,如果 maxWidth 大于 $thiswidth() maxHeight大于$thisheight(),会返回true;否则,它将返回false

关于javascript - 有人可以帮我解释一下这个返回声明吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12516077/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com