Skip to content

Instantly share code, notes, and snippets.

@Gerhut
Created February 6, 2015 03:25
Show Gist options
  • Select an option

  • Save Gerhut/3b92ff4373143daba76b to your computer and use it in GitHub Desktop.

Select an option

Save Gerhut/3b92ff4373143daba76b to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
funcProto = Function.prototype
funcCall = funcProto.call
funcApply = funcProto.apply
funcProto.call = function () {
console.log(this.name + ' called')
}
funcProto.apply = function () {
console.log(this.name + ' applied')
}
function fn() { console.log('fn executed') }
fn()
fn.call()
fn.apply()
</script>
<script id="jsbin-source-javascript" type="text/javascript">funcProto = Function.prototype
funcCall = funcProto.call
funcApply = funcProto.apply
funcProto.call = function () {
console.log(this.name + ' called')
}
funcProto.apply = function () {
console.log(this.name + ' applied')
}
function fn() { console.log('fn executed') }
fn()
fn.call()
fn.apply()</script></body>
</html>
funcProto = Function.prototype
funcCall = funcProto.call
funcApply = funcProto.apply
funcProto.call = function () {
console.log(this.name + ' called')
}
funcProto.apply = function () {
console.log(this.name + ' applied')
}
function fn() { console.log('fn executed') }
fn()
fn.call()
fn.apply()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment