JavaScript object detection
===

I am currently practicing javascript and I'm currently having trouble with object detection.  I want to create an object and detect whether it exists.  Below is some example code I am currently using.

The code sample below is how I am creating my object.
*****************
    var obj = obj || {};
*****************

    Should I be using this?

    if (typeof obj !=== "undefined") {
       // code
    }

    Or this?

    if (obj !=== null) {

    }