After an AJAX request, sometimes my application may return an empty object, like:
var a = {};
How can I check whether that’s the case?
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
ECMA 5+:
Note, though, that this creates an unnecessary array (the return value of
keys
).Pre-ECMA 5:
jQuery:
lodash:
Underscore:
Hoek
ExtJS
AngularJS (version 1)
Ramda