Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
  
  
</head>
<body>
</body>
</html>
 
function joint(a){var b;return b=a[a.length-1],a.pop(),a=a.length>1?joint(a):a[0],function(){b.apply(new a)}}
// My original function that I want to extend
function my_func() {
  console.log( "Original functionality." );
}
// Function with the new functionality
function new_func() {
  console.log( "New functionality." );
}
// Add the functionality of new_func to my_func 
my_func = joint([ my_func, new_func ]);
// Now run the original function with the new functionality
my_func();
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers