What is the difference between and in JavaScript

0 votes

I came across this query and am considering the similar issue in JavaScript.

When creating strings in JavaScript, using the character'or the character " seems to have no effect on how the application functions. What distinguishes these two characters from one another, then?

The only benefit I can think of for using'to construct strings is that I can do things like

var toAppend = '<div id="myDiv1"></div>';

Instead of:

var toAppend = "<div id=\"myDiv1\"></div>";

Is there any significant difference between them that I should be aware of?

:

Sep 23 in Java-Script by Abhinaya
• 1,160 points
47 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Java-Script

0 votes
1 answer

What is the difference between node.js and io.js?

Hello, io.js: Node-forward is basically being merged into io.js forked on ...READ MORE

answered Apr 24, 2020 in Java-Script by Niroj
• 82,800 points
322 views
0 votes
0 answers

What is difference between mutable and immutable String in java?

As far as I know, An immutable string ...READ MORE

Sep 22 in Java-Script by Tejashwini
• 2,860 points
48 views
0 votes
1 answer

What is callback function in JavaScript?

callback is not a keyword, its just ...READ MORE

answered Jan 30, 2020 in Java-Script by Niroj
• 82,800 points
12,284 views
0 votes
1 answer

What is the “hasClass” function with plain JavaScript?

Hello @Kartik, Simply use classList.contains(): if (document.body.classList.contains('thatClass')) { ...READ MORE

answered Sep 2, 2020 in Java-Script by Niroj
• 82,800 points
411 views
0 votes
1 answer

what is the $(document).ready equivalent without jQuery?

Hello @kartik, There are three options: If script is the last ...READ MORE

answered Apr 2, 2020 in Java-Script by Niroj
• 82,800 points
14,324 views
0 votes
0 answers

How to convert a string to an integer in JavaScript?

How do I convert a string to ...READ MORE

May 2 in Others by Kichu
• 19,040 points
84 views
0 votes
0 answers

How do you reverse a string in-place in JavaScript?

How do you reverse a string in ...READ MORE

May 23 in Java-Script by Kichu
• 19,040 points
70 views
0 votes
1 answer

JQuery string contains check

In this case, we will use the includes() ...READ MORE

answered Jun 14 in JQuery by rajatha
• 7,480 points
111 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP