var strStudentName = "Tom" + ' Thomas'; //Correct var strStudentAddress = "12/56, ' + 'Arizona "; //Incorrect; due to the quote nesting issues
There is no definite answer as both single and double quotes are interchangeable and you can use whatever you find convenient.
var strHtml = '<div id="p0_content">This is a test</div>";
In the above code snippet we’ve used single quote for the string value and double quotes for enclosing the attribute value in the markup. It looks simple and elegant.