0

I'm experimenting with localstorage, and I have the following snippet, and I wonder why it won't do anything.

    var tuotteita = localStorage.getItem("simpleCart_items");
    if(tuotteita != NULL){
    alert(tuotteita);
    }

It looks fine to me?

4
  • ReferenceError: NULL is not defined Commented Sep 21, 2012 at 15:58
  • @aziz.punjani in other words...? Commented Sep 21, 2012 at 15:59
  • 4
    js is case sensitive use null Commented Sep 21, 2012 at 16:00
  • Oh... Seems like I mixed it with php. Commented Sep 21, 2012 at 16:01

1 Answer 1

2

use null instead of NULL (lowercase)

Sign up to request clarification or add additional context in comments.

1 Comment

techincally lowercase small caps is a whole different thing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.