Lodash _.isNative() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Lang

Definition

Checks if value is a pristine native function from the JavaScript engine. Part of Lodash Lang since 3.0.0 (stable API — not deprecated, but see warning).

Pass the value you want to inspect or convert. Read the return type carefully before you use the result.

Syntax

Call _.isNative. Start with this line.

Lodash
_.isNative(value)
CallWhat it does
_.isNative(value)Primary signature.

Prefer import isNative from "lodash/isNative" when you want a smaller bundle.

Library declarations
Lodash
_.isNative(value)

Parameters

ParameterDescription
valueRequired. The value to check

Return Value

Return ValueDescription
*true if pristine native, else false

Lodash Examples

Example 1 — Official: Array.prototype.push

A pristine array method from the engine is native.

Lodash
_.isNative(Array.prototype.push);
// → true
Try It Yourself

How It Works

  1. Input. Official sample: Array.prototype.push.
  2. Source. Its toString looks like native code.
  3. Result. true — pristine built-in.
  4. Note. Replacing or wrapping push can break this.

Example 2 — Official: Lodash _

The Lodash export is a library function, not a native.

Lodash
_.isNative(_);
// → false
Try It Yourself

How It Works

  1. Input. Official sample: the Lodash function _.
  2. Not built-in. It is authored JavaScript, not engine code.
  3. Result. false.
  4. Lesson. Popular ≠ native.

Example 3 — User-Defined Function

Your own functions never count as native.

Lodash
function add(a, b) {
  return a + b;
}

_.isNative(add);                 // → false
_.isNative(function () {});      // → false
_.isNative(() => 1);             // → false
Try It Yourself

How It Works

  1. Declarations. Named, anonymous, and arrow functions are user code.
  2. Fingerprint. Their source is visible JS, not [native code].
  3. Result. All return false.
  4. Related. Use _.isFunction if you only care that something is callable.

Example 4 — Other Untouched Builtins

Many engine methods pass when not replaced by polyfills.

Lodash
_.isNative(Object.keys);   // → true (typical)
_.isNative(Math.max);      // → true (typical)
_.isNative(parseInt);      // → true (typical)
Try It Yourself

How It Works

  1. Builtins. Common engine functions usually fingerprint as native.
  2. Environment. Results assume no masking polyfill.
  3. core-js. With masking shims, Lodash may throw instead.
  4. Advice. Do not hard-depend on these results for production feature gates.

Example 5 — Non-Functions

Only functions can be native functions.

Lodash
_.isNative(null);          // → false
_.isNative({});            // → false
_.isNative('push');        // → false
_.isNative(Array);         // → true  (Array is a native function)
Try It Yourself

How It Works

  1. Null / object / string. Not functions → false.
  2. Array constructor. Array itself is a native function → true.
  3. Names. The string "push" is not the method.
  4. Rule. Pass the function reference, not a label.

Browser & Runtime Support

_.isNative is a Lodash Lang helper (available since 3.0.0, stable in 4.x). It runs anywhere Lodash runs — modern browsers (via CDN or bundle) and Node.js / Bun / Deno with npm install lodash. Reliability depends on an unmasked host: apps loading core-js / babel-polyfill may hit the documented throw.

✓ Stable · Caution with core-js

_.isNative()

Available in [email protected] full builds and the lodash/isNative modular import. Works in evergreen browsers and current Node LTS when Lodash is installed — treat results carefully under polyfills.

Caution Host-dependent
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support
_.isNative Lodash 3.0.0+

Bottom line: API is available wherever Lodash is. Prefer feature detection in polyfilled apps. Prefer import isNative from "lodash/isNative" for smaller builds, and catch errors if core-js may be loaded.

Frequently Asked Questions

_.isNative(value) returns true if value is a pristine native function provided by the JavaScript engine (for example Array.prototype.push). User-defined functions and Lodash itself return false.
Lodash is ordinary JavaScript shipped as a library — not an engine built-in — so its Function#toString fingerprint does not match native code.
Yes. Official docs note that when core-js (or packages like babel-polyfill that use it) masks native detection, Lodash may throw an error instead of returning a misleading false.
Not always. Prefer explicit feature checks ("does this API exist and behave correctly?") over relying on isNative in polyfilled environments.
Usually no. Wrappers, binds, and polyfill replacements often lose the pristine native fingerprint.
Use import isNative from "lodash/isNative" or require("lodash/isNative"). Full build: import _ from "lodash" then _.isNative.

Next: _.isNil()

Check whether a value is null or undefined in one call.

_.isNil() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

10 people found this page helpful