UNPKG

locutus

Version:

Locutus other languages' standard libraries to JavaScript for fun and educational purposes

12 lines (11 loc) 491 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.array_key_exists = array_key_exists; function array_key_exists(key, search) { // discuss at: https://locutus.io/php/array_key_exists/ // original by: Kevin van Zonneveld (https://kvz.io) // improved by: Felix Geisendoerfer (https://www.debuggable.com/felix) // example 1: array_key_exists('kevin', {'kevin': 'van Zonneveld'}) // returns 1: true return String(key) in search; }