Javascript DOM- Element Sizes
The size property of the Set object returns a number representing the number of elements in the current set object using javascript size.
Syntax:
Obj.size();
Example:
<html>
<head>
<title>JavaScript Example</title>
</head>
<body>
<script type="text/javascript">
const setObj = new Set();
setObj.add('Java');
setObj.add('JavaFX');
setObj.add('JavaScript');
setObj.add('HBase');
document.write("Size of the Set object: "+setObj.size);
</script>
</body>
</html>
OUTPUT:
Size of the Set object: 4
