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

154
Views
How do I remove property from a JavaScript object?

ay I create an object as follows:

let myObject = {
  "ircEvent": "PRIVMSG",
  "method": "newURI",
  "regex": "^http://.*"
};

How should I remove the property regex to end up with new myObject as follows?

let myObject = {
  "ircEvent": "PRIVMSG",
  "method": "newURI"
};
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

let myObject = {
  "ircEvent": "PRIVMSG",
  "method": "newURI",
  "regex": "^http://.*"
};

delete myObject.regex;
console.log(myObject);

The delete operator deletes both the value of the property and the property itself. You can check in https://www.w3schools.com/howto/howto_js_remove_property_object.asp

about 4 years ago · Juan Pablo Isaza Report

0

You can try - delete myObject.regex

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!