I want to be able to pass a string literal,
'this is a string'
or javascript object,
{one: 'this', two: 'is', three: 'a', four: 'string' }
as an argument to a function and take different actions depending on whether it is a string or an object. How to determine what is true?
To be specific, I want to iterate over the properties of an object and parse if the property is a string, but recursively nested if the property is an object. I figured out how to use $.each() to iterate over the properties of an object, but if I just do it with a string, it treats the string as an array of letters, and not as one thing. Can I get around this differently?
javascript jquery string object
Tomas lycken
source share