Quick actions

cmd+k|ctrl+k

Navigation

Languages

logical table

Snippet info

Language

JavaScript

Visibility

public

Author

pinstudio

Created

2026-02-11T08:18:33.958699Z

Updated

2026-02-11T08:45:34.980103Z

x = false || undefined || null || 0 || NaN || "x"; //last one value
console.log(x);

console.log("_____________________")

x = false || 1 || undefined || null || 0 || NaN || "x"; //the value 1 = true value, so [OR] will stop calculation
console.log(x);

console.log("_____________________");

y = [] && {} && 1 && true && "hello";
console.log(y);

console.log("_____________________");

y = [] && 0 && {} && 1 && true && "hello"; //[AND] will stop calculaton for false value
console.log(y);

console.log("_____________________");

default_city ="kw";
city = "";
city = city || console.log("please input city") || default_city; //console.log's result is undefined
console.log(city);

console.log("_____________________");

INFO