Bug Tracker

Opened 16 years ago

Closed 16 years ago

Last modified 11 years ago

#1451 closed bug (wontfix)

Boolean expression or conditional operator

Reported by: hobbit Owned by:
Priority: minor Milestone: 1.2.1
Component: core Version: 1.2
Keywords: Cc:
Blocked by: Blocking:

Description

trim: function(t){
  return (t||"").replace(/^\s+|\s+$/g, "");
}

The following expression is shorter and faster.

trim: function(t){
  return t?t.replace(/^\s+|\s+$/g, ""):"";
}

Change History (1)

comment:1 Changed 16 years ago by john

Milestone: 1.1.41.2.1
Resolution: wontfix
Status: newclosed
Version: 1.1.31.2
Note: See TracTickets for help on using tickets.