Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 16. JavaScript Objects > Preventing Object Extensibility

recipe 16.9. Preventing Object Extensibility

16.9.1. Problem

You want to prevent others from extending an object.

16.9.2. Solution

Use the new ECMAScript 5 Object.preventExtensions method to lock an object against future property additions:


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial