Click here to Skip to main content
15,889,200 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
JavaScript
var object1 = 
{
    propName: function(abc) 
    {
        this.prop1 = 'set'        
    }


What I have tried:

I am new to the javascript. I tried to print the 'set' to the web browser console. but it is not working. Can any can show me how to do this
Posted
Updated 20-May-16 9:35am
v3
Comments
Karthik_Mahalingam 20-May-16 7:19am    
post your code for printing in console.

1 solution

JavaScript
var object1 = 
{
    propName: function (abc) {
        this.prop1 = 'set'
    }
}

object1.propName(null);
console.log(object1.prop1);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900