Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9277907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:13:39+00:00 2026-06-18T17:13:39+00:00

I came across an interesting article . Which states unless until we are defining

  • 0

I came across an interesting article. Which states unless until we are defining JSON we should use only single quote.

var foo = 'bar'; //Right way   

var foo = "bar"; //Wrong way

Can anyone put light on this, why is it so?

Any help greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T17:13:41+00:00Added an answer on June 18, 2026 at 5:13 pm

    The most likely reason is programmer preference / API consistency.

    Strictly speaking, there is no difference in meaning; so the choice comes down to convenience.

    Here are several factors that could influence your choise:

    • House style: Some groups of developers already use one convention or the other.
    • Client-side requirements: Will you be using quotes within the strings? (See Ady’s answer).
    • Server-side language: VB.Net people might choose to use single quotes for java-script so that the scripts can be built server-side (VB.Net uses double-quotes for strings, so the java-script strings are easy to distinguished if they use single quotes).
    • Library code: If you’re using a library that uses a particular style, you might consider using the same style yourself.
    • When using single quotes, any apostrophe needs escaping. ('Joe\'s got a cool bike.') When using double quotes, they don’t. ("Joe's got a cool bike.") Apostrophes are much more common in English strings than double quotes.
    • Personal preference: You might thing one or other style looks better.

    Please check following post that might be helpful for you When to Use Double or Single Quotes in JavaScript

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

so i came across this interesting article on WPF exception handling: http://srtsolutions.com/public/item/251263 it works
While doing some casual reading I came across an interesting quote by Scott Meyers
I have came across very interesting problem which I think it's on Salesforce's end
I'm using CodeIgniter and I came across an interesting problem. I need to use
Today while helping someone I came across an interesting issue which I couldn't understand
I recently came across an interesting line of code that waits until a particular
I came across this Slate article that presents data in a new and interesting
I came across an interesting algorithm question in an interview. I gave my answer
I just came across an interesting LogCat entry: 06-28 08:43:25.616 I Web Console 5075
I just came across the interesting problem of trying to trim the leading zeroes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.