Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

90
Views
Replace String with value `$&' not working in javascript

I have string show {{value}} and I want replace {{value}} with $& but it not work. It return current value show {{value}}. Here is my code

let data ="show {{value}}";
let output = data.replace("{{value}}","$&");
alert(output);

I don't know why it not work. I try replace with other strings same $1, $a and it work. How I can fix my problem

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

$ is a special symbol in javascript. Write $$& instead and it should work :)

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!