var resultsArray = /* assign a value to resultsArray... */
(typeof response.d) == 'string' ? /* ...if the type of response.d is string */
eval('(' + response.d + ')') : /* ...then evaluate it as if it was JS code */
response.d; /* ...else just assign it unaltered */