Public
Script
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
1
2
3
4
5
6
7
8
9
const a = undefined;
const b = {};
const c = { foo: null };
const d = { foo: [1, 2] };
console.log(a?.foo?.length > 0);
console.log(b?.foo?.length > 0);
console.log(c?.foo?.length > 0);
console.log(d?.foo?.length > 0);
February 7, 2024