In JavaScript, which of the statements below can be used for string declaration?
1) var cst="PHPKB Knowledge Base Software";
2) var cst=new String("PHPKB Knowledge Base Software");
a) Either (1) or (2)
b) Only (1)
c) Neither (1) nor (2)
d) Only (2)

Respuesta :

For a string primitive, b. For a String object, d. If we're non-specific, a.