JSFiddle - React, Tailwind, and code Playground
JavaScript
var fns = ( function(){
var fn = new Function( 'with( this ){ return ' + Function.apply( this, arguments ).toString() + '; }' );
fn = fn.call( this );
return function(){
return fn.apply( this, arguments );
};
} ).apply( { bb: 789 }, [ 'a', 'b', ' alert(a+b); alert(this); alert( "bb: " + bb ); return bb; ' ] );
alert( 'result: ' + fns.call( 123, 5, 5 ) );