Happy
Happy

Reputation: 891

jQuery if not exist

This means "if exist"

if($.cookie("movies_list")) {
// do something
}

How to write "if not exist" without changing the structure?

Upvotes: 2

Views: 652

Answers (1)

Sarfraz
Sarfraz

Reputation: 382881

Prepend the not operator !

if(! $.cookie("movies_list")) {
// do something
}

! Operator

Upvotes: 10

Related Questions