const arr = [1,2,3];
arr.map(x => 2*x);
arr.filter(x => x % 2 == 0);
arr = [1,2,3]
[2*x for x in arr]
[x for x in arr if x % 2 == 0]
for .every
and .some
you can use the builtins all
and any
with a generator comprehension so that you get early return without evaluating every item:
const arr = [1,2,3];
arr.every(x => x < 3);
arr.some(x => x % 2 === 0);
arr = [1,2,3];
all(x < 3 for x in arr)
any(x % 2 == 0 for x in arr)
var1 = 10
`${var1}`
# Formatted string
var1 = 10
f"{var1}"
a = undefined
function bb() { console.log("No way to be called") }
a && bb()
a
def bb():
print("No way to be called")
a and bb()