What's Does the Dollar Sign ($"String") Do

What does ${} (dollar sign and curly braces) mean in a string in JavaScript?

You're talking about template literals.

They allow for both multiline strings and string interpolation.

Multiline strings:

console.log(`foobar`);// foo// bar

What is the purpose of the dollar sign in JavaScript?

A '$' in a variable means nothing special to the interpreter, much like an underscore.

From what I've seen, many people using jQuery (which is what your example code looks like to me) tend to prefix variables that contain a jQuery object with a $ so that they are easily identified and not mixed up with, say, integers.

The dollar sign function $() in jQuery is a library function that is frequently used, so a short name is desirable.

what does '$' sign represent in x86 assembly?

'$' marks end of ASCII stream in MS-DOS int 21h call AH = 09, print string; it's substitute in C would be ASCII zero.

Without more context, I would expect user input to be written over INSTR1, in which case the input (with length between 0 and 29 inclusive) would be automatically terminated by the dollar sign (and thus ready for printing with int 21h).

Meaning of $ in a string?

To Python, those dollar signs mean nothing at all. Just like the 'D' or 'a' that follow, the dollar sign is merely a character in a string.

To your source-code control system, the dollar signs indicate a substitution command. When you check out a new copy of your source code, that string is replaced with the timestamp of the last committed change to the file.

Reference:

  • http://svnbook.red-bean.com/en/1.6/svn.advanced.props.special.keywords.html
  • http://www.badgertronics.com/writings/cvs/keywords.html


Related Topics



Leave a reply



Submit