Sunday 15 July 2012

javascript - variable gets assigned function -



javascript - variable gets assigned function -

my english language = google translate. sorry :(

function xxx(){ abc = function(){return 'message';} homecoming abc; } function alerttt(){ var alerttext= xxx(); alert(alerttext); }

result:

alerttext = function(){return 'message';}

i want to:

alerttext = message

how can do?

are looking this?

class="snippet-code-js lang-js prettyprint-override">function xxx() { abc = function(){return 'message';} homecoming abc; } function alerttt() { var alerttext = xxx()(); alert(alerttext); } alerttt();

calling xxx returns function object, xxx() function object, , need phone call function object xxx()() homecoming 'message'.

javascript function variables

No comments:

Post a Comment