Skip to content

Commit 4bda5f0

Browse files
== null checks for null and undefined
"It's actually quite useful to do == null or != null as it will pass (or fail) if the value is either null or undefined." http://docs.jquery.com/JQuery_Core_Style_Guidelines
1 parent e60f7e8 commit 4bda5f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jquery.cookie.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
$.cookie = function(key, value, options) {
1212

1313
// key and at least value given, set cookie...
14-
if (arguments.length > 1 && (!/Object/.test(Object.prototype.toString.call(value)) || value === null || value === undefined)) {
14+
if (arguments.length > 1 && (!/Object/.test(Object.prototype.toString.call(value)) || value == null)) {
1515
options = $.extend({}, $.cookie.defaults, options);
1616

17-
if (value === null || value === undefined) {
17+
if (value == null) {
1818
options.expires = -1;
1919
}
2020

0 commit comments

Comments
 (0)