The Javascript handler getPrototypeOf() method traps for the internal method.
Syntax:
getPrototypeOf(target)
Parameters:
target: It represents the target object.
Return:
An object or null.
Example:
<!DOCTYPE html>
<html>
<body>
<script>
var handler = {};
var arr = new Proxy(handler, {
getPrototypeOf(arg) {
return Array.prototype;
}
});
document.write(
arr instanceof Array
);
</script>
</body>
</html>