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

  • SEARCH
  • Home
  • 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 6241011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:40:41+00:00 2026-05-24T11:40:41+00:00

var MM = ‘\’ + obj[0][‘MM ‘] + ‘/’; I get two errors while

  • 0
var MM = '\' + obj[0]['MM '] + '/';

I get two errors while using this code…

missing; before statement and
unterminated string literal

  • 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-05-24T11:40:42+00:00Added an answer on May 24, 2026 at 11:40 am

    The character \ is “special” because it’s used to allow the use of all printable characters in strings. In your case '\' is not a string composed by the only character \, but the beginning of a string starting with the single quote character '.

    For exampe if you want the string Hello Andrea "6502" Griffini you can use single quotes

    string1 = 'Hello Andrea "6502" Griffini';
    

    and if you want single quotes in the string you can do the opposite

    string2 = "Hello Andrea '6502' Griffini";
    

    But what if you want both kind of quotes in the same string? This is where the escape \ character comes handy:

    string3 = "'llo Andrea \"6502\" Griffini";
    

    Basically \ before a quote or double quote in a string tells javascript that the following character is just a regular character, with no special meaning attached to it.

    Note that the very same character is also used in regular expressions… for example if you want to look for an open bracket [ you must prefix it with a backslash because [ in a regular expression has a special meaning.

    The escape is also used to do the opposite… in a string if you put a backslash in front of a normal character you are telling javascript that that character is indeed special… for example

    alert("This is\na test");
    

    In the above line the \n sequence means a newline code, so the message displayed will be on two lines (“This is” and “a test”).

    You may now wonder… what if I need a backslash character in my string? Just double it in that case. In your code for example just use '\\'.

    Here is a table for the possible meanings of backslash in strings

    \"       just a regular double-quote character, it doesn't end the string
    \'       just a regular single-quote character, it doesn't end the string
    \b       a backspace character (ASCII code 0x08)
    \t       a tab character (ASCII code 0x09)
    \n       a newline character (ASCII code 0x0A)
    \v       a vertical tab character (ASCII code 0x0B)
    \f       a form feed character (ASCII code 0x0C)
    \r       a carriage return character (ASCII code 0x0D)
    \033     the character with ASCII code 033 octal = 27 ("ESC" in this case)
    \x41     the character with ASCII code 0x41 = 65 ("A" in this case)
    \u05D0   the unicode character 0x05D0 (Aleph from the Hebrew charset)
    \\       just regular backslash character, not an escape prefix
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

var $name = ('div#amuchlongername'); $('#wrapper').prepend('<div id=$name></div>'); Obviously I know this code is wrong lol,
var newFieldShow = function(hash) { hash.w.fadeIn(2000); }; I see this in some code I
var htm = $.ajax({ type: GET, url: ./viewforms, async: false }).responseText; var myObject =
var CoreGroups = new function(){ this.name = function(){return 'name test'}; var functionName = function(){
var array1 = {}; array1['one'] = new Array(); array1['one']['data'] = 'some text'; array1['one']['two'] =
var obj = { '51' : { 'name':'name1'}, '66' : { 'name':'name2'}, '58' :
var buffer = new byte[short.MaxValue]; var splitString = new string[] {\r\n}; while (_tcpClient.Connected) {
var valueAsText = $('#counts span').text(); I use this tiny script to parse a span
var Box = function(){ this.parm = {name:rajakvk,year:2010}; Box.prototype.jspCall = function() { $.ajax({ type: post,
var target = $(this).attr(href); if {target is child of ('.wrapper')} then (do something) simple

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.