Bug Tracker

Opened 14 years ago

Closed 14 years ago

Last modified 10 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:


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 14 years ago by john

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.