0

In javaScript, the strings can be assigned in one of the following manner:

  1. var str = "string";
  2. var str = 'string';

While I don't see any visible difference between the two in practice (areas where they are defined, propagated or consumed), I would like to know the exact difference between these two methodologies. Do we have any difference internally in the architecture? If yes, Do we have any implications?

proof of documents is much appreciated

sreepurna
  • 1,562
  • 2
  • 17
  • 32

2 Answers2

1

There is no difference. Just have the same consistency. So you wouldn't get lost.

Amir H. Bagheri
  • 1,416
  • 1
  • 9
  • 17
0

If you just use to assign the simple string, they're same
But with HTML content, you will see,
we have to use the ' or " inside the rest

var str = "<div style='color:red;'>1st String</div><BR>";
document.write(str);
var str = '<div style="color:red;">2nd String</div><BR>';
document.write(str);
Chien_Khmt
  • 257
  • 2
  • 8