For example we have JavaScript object woof_current_values. So if its necessary to define is item with key 'stock' exists in it we can do it with the next js script:
1 2 3 4 5 | if (Object.keys(woof_current_values).length === 1) { if ('stock' in woof_current_values) { //any code here } } |
