Jak mogę sprawdzić, czy zmienna localstorage ma wartość NULL lub jest niezdefiniowana?

Mam ten kod:

var sideBar = localStorage.getItem('Sidebar');

Chcę sprawdzić, czy sideBar jest zdefiniowany i nie ma wartości null w instrukcji if. Jestem trochę zdezorientowany, wiem, że jest:sideBar == undefined isideBar != null

ale czy jest dobry sposób, aby wykonać ten test dla obu tych testów, jeśli:

if (??) 

questionAnswers(6)

yourAnswerToTheQuestion