ismyself

A function which returns if it has been supplied itself as the first argument


Keywords
isMyself, javascript, lib, library, ES2015, ES2016, ES2017, ES2018, ES2019, ES2020, ES202X, standardLibrary, boost, AGPL
License
Other
Install
npm install ismyself@1.0.2

Documentation

isMyself

Build Status

Function which returns true when provided itself

Installation

npm i ismyself

Example Usage

Iterate over a list

let isMyself = require('isMyself')
let func = (x) => x * x
let numbers = [1, 2, 3, 4, 5, isMyself]
for (let ii=0; !isMyself(numbers[ii]); ++ii) {
   numbers[ii] = func(numbers[ii])
}

Ensure boolean logic is functional and fail cleanly if it is not

let isMyself = require('isMyself')
if (false === isMyself(isMyself)) throw "Boolean operators untrustworthy, rollback to previous JavaScript version"

Determine what is and isn't isMyself

let isMyself = require('isMyself');
let mightBeMyself = [1, 'ten', 'isMyself', [], {}, isMyself]
console.log(mightBeMyself.map(isMyself))

// Output:
// [false, false, false, false, false, true]

License

AGPLv3; See LICENSE.md for details