🐒: if (a == 2) return true else return false
source link: https://www.v2ex.com/t/949367
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
🤡: return a == 2 ? true : false;
return a == 2 😅:???
茴茴茴茴茴茴茴茴茴茴茴茴茴茴茴茴茴茴茴茴茴茴茴
cczhrd 7 小时 37 分钟前 1 while(a==2) return true return false
|
wu67 7 小时 34 分钟前 准确的说, 局限于 js 场景, 应该是 return a === 2, 其他有强类型的才是==
|
sechi 7 小时 33 分钟前 if (a === true)
return true else return false |
cczhrd 7 小时 30 分钟前 return a-1==1
return a-2==0 .... .... |
cczhrd 7 小时 29 分钟前 for(;;) return a==2
|
taotaodaddy 7 小时 12 分钟前 > "4" + "2" - "2" === 40
true |
ccyu220 6 小时 47 分钟前 return !isNaN(number) && Number(number) === 2
|
JinshengChen 6 小时 42 分钟前 ???想表达啥
|
kera0a 6 小时 36 分钟前 via iPhone 他那个例子不好直接 return ,需要对全局变量赋值
应该是页面上的元素绑定了 |
zhujiaofan 6 小时 30 分钟前 if (!true)
return true ? false : true else return false ? true : false |
bv 6 小时 25 分钟前 if (a == 2 == true) return true else return false
|
chendy 6 小时 24 分钟前 只能说有时候脑抽了会这么写
但是 ide 有警告,直接自动修复就完事了 |
mxT52CRuqR6o5 6 小时 16 分钟前 4 不是还有个著名的笑话:如果我和老婆意见一致,那就听我的;如果意见不一致,那就听老婆的
return a==b?a:b |
lovelylain 6 小时 13 分钟前 via Android if (a==1 && b==2) || (a!=1 && b!=2) {
} |
sillydaddy 3 小时 28 分钟前 @mxT52CRuqR6o5 #17
你这个可以放到程序员的冷笑话集锦里,😂太逗了,还有没有类似的。 |
EscYezi 3 小时 20 分钟前 via Android return Optional.ofNullable(a)
.map(Objects::toString) .map(BigDecimal::new) .map(d->d.compareTo(new BigDecimal (2))==0) .orElse(false); 😜 |
beijinglowb 3 小时 12 分钟前 @EscYezi rxjs 是这样的
|
cyrbuzz 2 小时 58 分钟前 !!!(2^a)
|
rabbbit 1 小时 35 分钟前 1 🐶
interface Is2Interface { is2(a: number): boolean; } abstract class AbstractIs2 implements Is2Interface { is2(a: number): boolean { return a === 2; } } class Is2 extends AbstractIs2 { is2(a: number): boolean { if (a === 2) { return true } else { return false } } } interface Is2FactoryInterface { getIs2(): AbstractIs2; } abstract class AbstractIs2Factory implements Is2FactoryInterface { getIs2(): AbstractIs2 { return new Is2(); }; } class Is2Factory extends AbstractIs2Factory { private is2: AbstractIs2 = new Is2(); getIs2(): AbstractIs2 { return this.is2; }; } class Main { public static main(): void { const is2Factory = new Is2Factory(); const is2 = is2Factory.getIs2(); const a = 2; console.log(is2.is2(a)); } } Main.main(); |
proxychains 1 小时 29 分钟前 via Android @rabbbit 这是更是重量级
|
ochatokori 1 小时 10 分钟前 via Android return a !== 2 ? false : true
|
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK