Thread: New Ideas
View Single Post
  #12  
Old 07-24-2001, 03:42 AM
General General is offline
Banned
Join Date: Apr 2001
Location: Station Square
Posts: 984
General is on a distinguished road
Send a message via ICQ to General Send a message via AIM to General Send a message via Yahoo to General
let me give you two pieces of code to show you
NPC Code:

//Code 1 - Functions take arguments
function happy(a,b) {
return a*b;
}
variable = happy(2,2);



NPC Code:

//Code 2 - No arguments
fucntion happy() {
this.return=a*b;
}
a=2;
b=2;
happy();
variable=this.return



in both cases variable winds up equaling 4...but notice how much shorter Code 1 is than code 2
Reply With Quote