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 6572577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:01:28+00:00 2026-05-25T15:01:28+00:00

I was trying to delete .insertBefore(); of HTMLElement.prototype but when I check for it,

  • 0

I was trying to delete .insertBefore(); of HTMLElement.prototype but when I check for it, instead of an undefined value, it returns the actual function? Why?

console.log(HTMLElement.prototype.insertBefore); // function insertBefore() { [native code] }

delete HTMLElement.prototype.insertBefore;

console.log(HTMLElement.prototype.insertBefore); // function insertBefore() { [native code] }

Can you explain why this isn’t working. I tried this on my own constructor and it worked, but for the built in ones, it didn’t.

  • 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-25T15:01:29+00:00Added an answer on May 25, 2026 at 3:01 pm

    You cannot use DELETE like that:

    http://perfectionkills.com/understanding-delete/

    Property attributes

    Every property can have zero or more attributes from the following set — ReadOnly, DontEnum, DontDelete and Internal. You can think of them as flags — an attribute can either exist on a property or not. For the purposes of today’s discussion, we are only interested in DontDelete.

    Built-ins and DontDelete

    So this is what it’s all about: a special attribute on a property that controls whether this property can be deleted or not. Note that some of the properties of built-in objects are specified to have DontDelete, and so can not be deleted. Special arguments variable (or, as we know now, a property of Activation object) has DontDelete. length property of any function instance has DontDelete as well.

    Seriously man, read that article. It has a ludicrously clear and concise explanation of all this!


    Note: even though they have the dontDelete attribute set, you can still overwrite it:

    HTMLElement.prototype.insertBefore = '';
    // or
    HTMLElement.prototype.insertBefore = null;
    // or
    HTMLElement.prototype.insertBefore = undefined;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to delete several working copy directories, but I get an Access Denied
I am trying to delete the all but the most recent 3,000 items in
Im trying to delete an sdf file in the .NET mobile framework, but I
I am trying to delete a few things before the actual delete of the
Trying to delete an unmapped class/record via the NHibernate sql api. But can't seem
I'm trying to delete a plugin I installed for rails (paperclip). But I actually
I'm trying to delete a user using Django Admin, but I get this error:
I'm trying to delete a mysql record with javascript but I fail. So this
I am trying to delete multiple rows from a GridView but I am struggling
I am trying to delete multiple records using check boxes. I've loaded each check

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.