how to return function value in javascript [closed]

You can return an object.

var Get_Event_Id = function() {     
    return {
        EventId: 3,
        EndTime: '2014-04-24T11:00:00'
    }
};
var test = Get_Event_Id();
console.log(test.EventId);

http://jsfiddle.net/8LcYr/

Browse More Popular Posts

Leave a Comment