Why Circular Reference is Bad in JavaScript

Ayush Gupta
Updated on 17-Sep-2019 08:02:47

1K+ Views

A circular reference occurs if two separate objects pass references to each other.In older browsers circular references were a cause of memory leaks. With improvements in Garbage collection algorithms, which can now handle cycles and cyclic dependencies fine, this is no longer an issue.However, from a pure design point of view, circular referencing is still a bad thing and a code smell. Circular referencing implies that the 2 objects referencing each other are tightly coupled and changes to one object may need changes in other as well.Avoiding circular referencesThere is no one way to avoid circular reference in JS. It ... Read More

HTML Textarea Disabled Attribute

AmitDiwan
Updated on 17-Sep-2019 07:58:58

79 Views

The disabled attribute of the element is used to disable . After disabling, you won’t be able to select the text from the .SyntaxFollowing is the syntax −ExampleLet us now see an example to implement the disabled attribute of the element − Live Demo Candidate Details Student Name: Student Id: Educational Qualification (Graduation) B.Tech BCA B.COM B.SC BBA Educational Qualification (Post-Graduation) MCA M.Tech M.COM M.SC Info: You need to also bring the certificates for the degrees mentioned above. OutputThis will produce the following output −In the above example, ... Read More

HTML Option Disabled Attribute

AmitDiwan
Updated on 16-Sep-2019 11:33:11

501 Views

The disabled attribute of the element is used to set a disabled option from a list of options. After that, the disabled option won’t be clickable.SyntaxFollowing is the syntax −ExampleLet us now see an example to implement the disabled attribute of the element − Live Demo Impurity level of Water Impurity Level 3:2 5:3 2L 5L 10L 20L OutputThis will produce the following output. Here, the option 5:3 under the optgroup Ratio −In the above example, we have option-groups and options inside it − 3:2 5:3 ... Read More

Difference Between Iterator and ListIterator in Java

Nitin Sharma
Updated on 16-Sep-2019 11:31:47

1K+ Views

Java provided these two interfaces to traverse the data one by one stored in a collection. The internal implementation of iterator and list iterator makes them differ apart but the main agenda of both the iterators is the same.The following are the important differences between Iterator and ListIterator.Sr. No.KeyIteratorListIterator1ApplicableIterator can be used to traverse any collection irrespective of the type of collection.List iterator can only be used to iterate only List collection implemented classes like arraylist, linkedlist etc.2CallingAs mentioned Iterator must be used to enumerate elements in all Collections implemented interfaces like Set, List, Queue, Deque and also in all ... Read More

HTML meter min Attribute

AmitDiwan
Updated on 16-Sep-2019 11:28:21

180 Views

The min attribute of the element is used to set the lower bound for . However, the element is used to measure data with a give range like water impurity level and it is set using the min and max attribute.SyntaxFor obvious reasons, the min value is less than the max value. The default is 0. Following is the syntax −The num above is a number in floating-point that sets the min attribute of the element.ExampleLet us now see an example to implement the min attribute of the element − Live Demo Water Levels Impurity ... Read More

HTML label for Attribute

AmitDiwan
Updated on 16-Sep-2019 11:16:41

271 Views

The for attribute of the element is used to set an element with a label.SyntaxFollowing is the syntax −Above, id is the associated element id.ExampleLet us now see an example to implement the for attribute of element − Live Demo Last Semester Results Result Student: Subject: Rank: OutputThis will produce the following output −In the above example, we have a form with some fields − Result Student: Subject: Rank: We have set the label for the field using for attribute of the element, ... Read More

Difference Between a Static Queue and a Singly Linked List in Java

Nitin Sharma
Updated on 16-Sep-2019 11:10:29

915 Views

In Java List and Queue both are introduced as an ordered list of objects, where the same object may be added more than once. The difference between both comes in the manner of adding elements. In the queue, all the elements get inserted at the rear and removed from the front while we can add an element anywhere in the list.Sr. No.KeyStatic QueueSingly Linked List1Data initialization.Static Queue works in first out(FIFO) fashion as all the elements get inserted at the REAR and removed from the FRONT of the queue.In the case of Singly Linked List, one can add elements anywhere ... Read More

HTML Input Disabled Attribute

AmitDiwan
Updated on 16-Sep-2019 11:07:23

286 Views

The disabled attribute of the element is used to disable element. When an element is disabled, it becomes unclickable. For obvious reasons, the disabled input element won’t get submitted.SyntaxFollowing is the syntax −Let us now see an example to implement the disabled attribute of the element −Example Live Demo Details These are the new details... New Details: Player: Rank: Email: Reporting Time: OutputThis will produce the following output wherein we have disabled one of the input element “Player” −In the above example, we have four fields −Player: ... Read More

HTML Block and Inline Elements

AmitDiwan
Updated on 16-Sep-2019 09:19:06

412 Views

Block ElementsThe block elements appear on a screen as if they have a line break before and after them. They also take up the entire available width. Some of the block elements include, to , , , , , , , , etc.ExampleLet us see an example of one of the block element , , , etc − Live Demo Coding Ground Compilers for Programming Languages and Web Technologies Click on the individual links to work on online compilers: Java | PHP | jQuery | C | C++ | AngularJS We also have complier for JS ... Read More

Differences Between Web Garden and Web Farm in JavaScript

Ayush Gupta
Updated on 16-Sep-2019 08:52:25

444 Views

Web Garden is the web hosting system which comprises of multiple “processes”. This means that we have a single server on which we run multiple processes. This type of hosting provides logical scalability to our web applications.Web Farm is the web hosting system which comprises of multiple “computers”. This is different from web-garden as web garden runs on a single server while a web farm runs across multiple servers. This provides physical scalability to out web applications. This type of set up is achieved using Load balancers to balance calls coming to the server using a dedicated process that forwards ... Read More

Advertisements