JavaScript Set add() methodThe JavaScript Set add() method is used to add a new object to the end of a WeakSet object. SyntaxThe add() method is represented by the following syntax: Parametervalue - It represents the object to be added. ReturnThe WeakSet object. JavaScript Set add() method exampleHere, we will understand add() method through various examples. Example 1Let's see an example to add object to WeakSet object. Test it NowOutput: true true Example 2In this example, we will see whether we add the objects to WeakSet object without initializing them. Test it NowOutput: ReferenceError: obj is not defined
Next TopicWeakSet delete() Method
|
JavaTpoint offers too many high quality services. Mail us on [email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected]
Duration: 1 week to 2 week