How would i do the below with Javascript?

```
var object

function() {
    return {
        object: Return true if object exists or object is set to true, or false if set to false, if object doesnt exisit return false
    }
}

```