Code design

Code design

Hi, 

I wonder if it is necessary to first check if an element exists before manipulate it?

For example:
  1. if ( $('#item_123').length === 1 ) {
  2.       $('#item_123').remove();
  3. }

Or can you simple use whether the item actually exist or not?
  1. $('#item_123').remove();

I know it both works, but what is the proper way to go?

Christophe


http://www.opera.com/