Monday, April 6, 2009

workshop 4

WORKSHOP ----4----
If command is used if you want to execute some code only if a specified condition is true.The syntax difference between Ruby and JavaScript is given below:

EXAMPLE OF RUBY IF COMMAND:
if var == 10
print "Variable is 10″
end

EXAMPLE OF JAVSCRPIT IF COMMAND:

if (condition)
{
code to be executed if condition is true
}

(ruby and javascrpit, 2008)


Similarities of Ruby and JavaScript:

* Memory is managed for you via a garbage collector.
* There’s public, private, and protected methods.
(Talim, 2008)

No comments:

Post a Comment