locutus
Version:
Locutus other languages' standard libraries to JavaScript for fun and educational purposes
16 lines (15 loc) • 630 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.add = add;
const _operator_ts_1 = require("../_helpers/_operator.js");
function add(a, b) {
// discuss at: https://locutus.io/python/operator/add/
// parity verified: Python 3.12
// original by: Kevin van Zonneveld (https://kvz.io)
// note 1: Adds numbers and concatenates strings or arrays like Python's operator.add.
// example 1: add(2, 3)
// returns 1: 5
// example 2: add('py', 'thon')
// returns 2: 'python'
return (0, _operator_ts_1.pythonAdd)(a, b, 'add');
}