JavaScript getPrototypeOf() method

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>
Please follow and like us:
Content Protection by DMCA.com