locutus
Version:
Locutus other languages' standard libraries to JavaScript for fun and educational purposes
13 lines (12 loc) • 484 B
JavaScript
import { pythonNot } from "../_helpers/_operator.js";
export function not_(a) {
// discuss at: https://locutus.io/python/operator/not_/
// parity verified: Python 3.12
// original by: Kevin van Zonneveld (https://kvz.io)
// note 1: Uses Python truthiness rules instead of raw JS Boolean coercion.
// example 1: not_([])
// returns 1: true
// example 2: not_(NaN)
// returns 2: false
return pythonNot(a);
}