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 Any Changes to an Object

recipe 16.11. Preventing Any Changes to an Object

16.11.1. Problem

You’ve defined your object, and now you want to make sure that its properties aren’t redefined or edited by other applications using the object.

16.11.2. Solution

Use the new ECMAScript 5 Object.freeze method to freeze the object against any and all changes:


  

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