How to list the properties of a JavaScript object? 275 As slashnick pointed out, you can use the "for in" construct to iterate over an object for its attribute names However you'll be iterating over all attribute names in the object's prototype chain If you want to iterate only over the object's own attributes, you can make use of the Object#hasOwnProperty () method Thus having the following
Multiple -and -or in PowerShell Where-Object statement 77 By wrapping your comparisons in {} in your first example you are creating ScriptBlocks; so the PowerShell interpreter views it as Where-Object { <ScriptBlock> -and <ScriptBlock> } Since the -and operator operates on boolean values, PowerShell casts the ScriptBlocks to boolean values In PowerShell anything that is not empty, zero or null is