Samual Sam has Published 2492 Articles

Atomics.store() function in JavaScript

Samual Sam

Samual Sam

Updated on 25-Jun-2020 09:53:45

85 Views

The Atomic object of JavaScript is an object and which provides atomic operations such as add, sub, and, or, xor, load, store etc. as static methods, these methods are used with SharedArrayBuffer objects.The store() function of the atomic object accepts a number(value) and a position in the array and, stores ... Read More

Remove all elements from a HashSet in Java

Samual Sam

Samual Sam

Updated on 25-Jun-2020 09:50:28

2K+ Views

To remove all the elements from HashSet, use the clear() method.Create a HashSet and initialize elements −String strArr[] = { "P", "Q", "R", "S" }; Set s = new HashSet(Arrays.asList(strArr));Now, to remove all the above elements −s.clear()The following is an example to remove all elements from a HashSet −Example Live Demoimport ... Read More

Get size of HashSet in Java

Samual Sam

Samual Sam

Updated on 25-Jun-2020 09:48:14

267 Views

To get the size of HashSet, use the size() method. Let us create a HashSet and add elements −Set hs = new HashSet(); hs.add(15); hs.add(71); hs.add(82); hs.add(89); hs.add(91);Let us now use size() and get the size of HashSet −hs.size()The following is an example to get the size of HashSet −Example Live ... Read More

Remove specified element from HashSet in Java

Samual Sam

Samual Sam

Updated on 25-Jun-2020 09:46:23

277 Views

To remove specified element from HashSet, use the remove() method.First, declare a HashSet and add elements −Set hs = new HashSet(); hs.add(20); hs.add(39); hs.add(67); hs.add(79); hs.add(81); hs.add(87); hs.add(88);Let’s say you need to remove element 39. For that, use the remove() method −hs.remove(39);The following is an example to remove specified element ... Read More

ArrayBuffer.byteLength Property in JavaScript

Samual Sam

Samual Sam

Updated on 25-Jun-2020 09:43:36

470 Views

ArrayBuffer object in JavaScript represents a fixed-length binary data buffer.The byteLength property of the ArrayBuffer returns an unsigned, 32-bit integer that specifies the size/length of the ArrayBuffer.SyntaxIts syntax is as followsarray.byteLengthExampleTry the following example. Live Demo JavaScript Example           var arrayBuffer = new ArrayBuffer(8); ... Read More

Perform Animation on CSS border-bottom-color property

Samual Sam

Samual Sam

Updated on 25-Jun-2020 09:35:50

72 Views

To implement animation on the border-bottom-color property with CSS, you can try to run the following code ExampleLive Demo    div {       width: 500px;       height: 400px;       background: yellow;       border: 10px solid yellow;       background-image: ... Read More

Perform Animation on CSS font-size property

Samual Sam

Samual Sam

Updated on 25-Jun-2020 09:00:59

755 Views

To implement animation on the font-size property with CSS, you can try to run the following codeExampleLive Demo                    p {             border: 2px solid black;             width: 400px;             height: 100px;             animation: myanim 5s infinite;          }          @keyframes myanim {             70% {                font-size: 30px;             }          }                     This is demo text    

How to display columns and rows using named CSS grid items

Samual Sam

Samual Sam

Updated on 25-Jun-2020 08:57:51

86 Views

To display columns and rows using named CSS, use the grid-area property, with the grid-template-areas propertyExampleLive Demo                    .container {             display: grid;             background-color: green;             grid-template-areas: 'demo demo . . .' 'demo demo . . .';             padding: 20px;             grid-gap: 10px;          }          .container > div {             background-color: orange;             text-align: center;             padding: 10px 0;             font-size: 20px;          }          .ele1 {             grid-area: demo;          }                     Game Board                1          2          3          4          5          6          

Set where to end the CSS grid item

Samual Sam

Samual Sam

Updated on 25-Jun-2020 08:49:32

71 Views

Use the grid-column-end property to set where to end the grid item. You can try to run the following code to implement the grid-column-end propertyExampleLive Demo                    .container {             display: grid;       ... Read More

Blending mode of each background layer with CSS

Samual Sam

Samual Sam

Updated on 25-Jun-2020 08:20:42

48 Views

Use the background-blend-mode property to set the blending mode of each background layer with CSS. You can try to run the following code to implement the background-blend-mode property and set the mode to darkenExampleLive Demo                    #myDIV {       ... Read More

Advertisements