Snippets: Javascript Logical Operators

June 25, 2007 @ 02:39 PM | posted by carmelyne

(last updated: 06.25.07)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// mathematical operators
+  addition
-  subtraction
*  multiplication
/  division
%  modulus (this is the remainder when you divide something)

//comparison operators
>   Greater Than
<   Less Than
>=  Greater Than or equal to
<=  Less Than or equal to
==  Equal to
!=  Not equal to 

Note:
("=" sign assigns a value to a variable, "==" compares two values for equality.)

[ Last updated: June 25, 2007 @ 02:41 PM ]

Sorry, comments are closed for this article.

Snippets of 06/24/07

Rails 'A'..'Z' Paginate

1
2
3
4
5
6
7
8
9
10
11
# Starts with 'A'..'Z' Paginate / model
def self.sort(sort)
  if sort
    find(:all, :conditions => ['name LIKE ?', "#{sort}%"])
  else
    find(:all, :order => 'name')
  end  
end

# index action / controller
@models = Model.sort(params[:sort]) 
RailsConf 2006
I heart devChix