JavaScript Reflect.apply() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Static method

Definition

Reflect.apply(target, thisArgument, argumentsList) calls a function for you. You give it the function, the value to use as this, and an array with the arguments. It returns whatever the function returns.

It does the same job as fn.apply(thisArgument, argumentsList), but as a normal function call. That means it still works when the function has its own property named apply, or when the function has no apply at all.

Remember
Reflect.apply(target, thisArgument, argumentsList)

target         → the function to call
thisArgument   → the value of this inside it
argumentsList  → an array (or array-like) of arguments

returns the result of the function
throws TypeError if target is not a function

Syntax

Call it on the Reflect object. Pass the function, a value for this, and an array of arguments.

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

console.log(Reflect.apply(add, undefined, [2, 3]));   // 5
console.log(Reflect.apply(Math.max, undefined, [4, 9, 1]));   // 9
CallWhat it does
Reflect.apply(fn, undefined, [1, 2])Call fn with the arguments 1 and 2, and no special this.
Reflect.apply(fn, obj, [])Call fn so that this is obj.
fn.apply(obj, [1, 2])The older way. It breaks if fn has its own apply property.
fn.call(obj, 1, 2)Like apply(), but the arguments are listed one by one.

A standard JavaScript static method (ES2015) of the Reflect object: call it as Reflect.apply(), not on a function. No import required. Siblings: Reflect.construct(), Reflect.defineProperty(), Reflect.deleteProperty(), Reflect.get(), Reflect.getOwnPropertyDescriptor(), Reflect.getPrototypeOf(), Reflect.has(), Reflect.isExtensible(), Reflect.ownKeys(), Reflect.preventExtensions(), Reflect.set(), Reflect.setPrototypeOf().

Library declarations
JavaScript
// ECMAScript 2015 (ES6)
Reflect.apply(target, thisArgument, argumentsList)

// target        : a function
// thisArgument  : the value of this
// argumentsList : an array-like object
// returns       : what target returns
// throws        : TypeError if target is not callable

Parameters

ParameterDescription
targetRequired. The function to call. If it is not a function, a TypeError is thrown.
thisArgumentRequired. The value to use as this inside the function. Pass undefined when the function does not use this.
argumentsListRequired. An array, or an array-like object, with the arguments. Pass an empty array [] for no arguments. A number or undefined here throws a TypeError.

Return Value

Return ValueDescription
Any valueThe value that the called function returns. If the function throws an error, that error is passed on to you.
TypeError (thrown)target is not a function, or argumentsList is not an object.

JavaScript Examples

Example 1 — Call a Function with an Array of Arguments

Find the biggest number, take a letter from a string, and make text upper case, all by passing an array of arguments.

JavaScript
const numbers = [3, 9, 4];

console.log("Biggest: " + Reflect.apply(Math.max, undefined, numbers));
console.log("Letter: " + Reflect.apply(String.prototype.charAt, "hello", [1]));
console.log("Upper: " + Reflect.apply(String.prototype.toUpperCase, "abc", []));
Try It Yourself

How It Works

  1. Array becomes arguments. Reflect.apply(Math.max, undefined, numbers) calls Math.max(3, 9, 4). Math.max does not use this, so undefined is fine.
  2. Borrow a method. String.prototype.charAt needs a string as this. Passing "hello" as the second argument makes it read letter number 1, which is "e".
  3. No arguments. toUpperCase() needs none, so the third argument is an empty array.

Example 2 — Choose the Value of this

The same function gives a different answer depending on the object that you pass as this.

JavaScript
function greet(greeting, mark) {
  return greeting + ", " + this.name + mark;
}

const ann = { name: "Ann" };
const bob = { name: "Bob" };

console.log(Reflect.apply(greet, ann, ["Hello", "!"]));
console.log(Reflect.apply(greet, bob, ["Welcome", "."]));
console.log(greet.apply(ann, ["Hi", "?"]));
Try It Yourself

How It Works

  1. One function, two owners. greet reads this.name. It does not belong to any object, so you decide what this is.
  2. Pass this and arguments. The second argument (ann or bob) becomes this, and the array gives greeting and mark.
  3. Same result as apply(). The last line uses greet.apply(), and it works the same way here. The next example shows when it stops working.

Example 3 — Safe Even When apply Is Replaced

A function can have its own property called apply. Then fn.apply() fails, but Reflect.apply() still works. The catch blocks print the error type only.

JavaScript
function add(a, b) {
  return a + b;
}
add.apply = "oops";

console.log("Reflect.apply: " + Reflect.apply(add, undefined, [2, 3]));

try {
  add.apply(undefined, [2, 3]);
} catch (err) {
  console.log("add.apply: " + err.name);
}

try {
  Reflect.apply("not a function", undefined, []);
} catch (err) {
  console.log("Not a function: " + err.name);
}

try {
  Reflect.apply(Math.max, undefined, 5);
} catch (err) {
  console.log("Not an array: " + err.name);
}
Try It Yourself

How It Works

  1. Replace apply. The line add.apply = "oops" hides the real apply method. add.apply(...) now tries to call a string and throws a TypeError.
  2. Reflect still works. Reflect.apply() does not look for a property on the function, so it calls add normally and returns 5.
  3. Wrong inputs. A string is not callable, and 5 is not an array of arguments, so both calls throw a TypeError.

Browser & Runtime Support

Reflect.apply() is part of ES2015 (ES6), together with the Reflect object. Every current browser and Node.js has it.

✓ ES2015 · Widely supported

Reflect.apply()

Supported in Chrome 49+, Edge 12+, Firefox 42+, Safari 10+, Opera 36+ and Node.js 6+. Internet Explorer never got it.

ES2015 Standard since
Google Chrome 49+ · Desktop & Mobile
Full support
Microsoft Edge 12+ · Chromium and legacy
Full support
Mozilla Firefox 42+ · Desktop & Mobile
Full support
Apple Safari 10+ · macOS & iOS
Full support
Opera 36+ · Chromium based
Full support
Samsung Internet Recent versions · Android
Supported
Android WebView 49+ · Chromium based
Supported
Node.js 6+ · Server runtime
Supported
Deno Supported · JavaScript runtime
Supported
Bun Supported · JavaScript runtime
Supported
Internet Explorer No native support
Not supported
Reflect.apply() Excellent

Bottom line: Safe to use in every current browser and in Node.js. The only thing to plan for is Internet Explorer, which has no Reflect at all.

Frequently Asked Questions

It calls a function with a value for this and an array of arguments, and returns the result. It is the function-style version of fn.apply(thisArgument, argumentsList).
They do the same job. Reflect.apply() takes the function as its first argument, so it does not depend on the function having a working apply property. It also throws a clear TypeError for wrong input.
Often not. Math.max(...numbers) is shorter. Use Reflect.apply() when you must also set this, when you are forwarding a call inside a Proxy, or when the function might have its own apply property.
Reflect.apply() throws a TypeError. It also throws a TypeError when the third argument is not an array or an array-like object, for example a number.
A Proxy can intercept calls with an apply trap. Inside the trap, Reflect.apply(target, thisArg, args) runs the original function with the original behaviour, so you can add logging or checks around it.

Next: Reflect.construct()

Learn how to create an object from a constructor with an array of arguments, like the new keyword but as a function.

Reflect.construct() 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.

11 people found this page helpful