61
rated 0 times
[
63]
[
2]
/ answers: 1 / hits: 23910
/ 11 Years ago, sat, december 14, 2013, 12:00:00
Let's say I have an object named a
, how could I check that a
has a specific list of multiple properties in shorthand, I think it can be done using in logical operator,
Something like this:
var a = {prop1:{},prop2:{},prop3:{}};
if ({1:prop1,2:prop2,3:prop3} in a)
console.log(a has these properties:'prop1, prop2 and prop3');
EDIT
If plain javascript can't help, jQuery will do, but i prefer javascript
EDIT2
Portability is the privilege
More From » jquery