Difference Between Bootstrap and AngularJS

Nitin Sharma
Updated on 17-Sep-2019 10:36:38

2K+ Views

Along with many other frameworks for front end development AngularJs and Bootstrap are two well-known frameworks in the market.AngularJS is widely used for single page application development as it provides MVC architecture with data model binding. On the other hand, Bootstrap uses HTML, CSS, and JavaScript for its development which makes it comparatively faster.The following are the important differences between Bootstrap and AngularJS.Sr. No.KeyAngularJSBootstrap1Basic DifferenceAngularJs was developed by Google and primarily uses a component concept which makes its developed application more structural.Bootstrap was introduced by Twitter as part of the open-source community with very common libraries such as CSS, Styles, ... Read More

Difference Between Arrays and Collection in Java

Nitin Sharma
Updated on 17-Sep-2019 10:34:05

15K+ Views

In order to store multiple values or objects of the same type, Java provides two types of data structures namely Array and Collection.The following are the important differences between Arrays and Collection.Sr. No.KeyArraysCollection1SizeArrays are fixed in size i.e once the array with the specific size is declared then we can't alter its size afterward.The collection is dynamic in size i.e based on requirement size could be get altered even after its declaration.2Memory ConsumptionArrays due to fast execution consumes more memory and has better performance.Collections, on the other hand, consume less memory but also have low performance as compared to Arrays.3Data ... Read More

HTML meter Max Attribute

AmitDiwan
Updated on 17-Sep-2019 09:15:03

142 Views

The max attribute of the element is used to set the upper 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.SyntaxFollowing is the syntax −The num above is a number in floating-point that sets the max attribute of the element.ExampleLet us now see an example to implement the max attribute of the element − Live Demo Water Levels Impurity Level TDS Level OutputThis will produce the following output −In the above example, ... Read More

HTML Design Form

AmitDiwan
Updated on 17-Sep-2019 09:07:50

5K+ Views

HTML Forms are required, when you want to collect some data from the site visitor. For example, during user registration you would like to collect information such as name, email address, credit card, etc.A form will take input from the site visitor and then will post it to a back-end application such as CGI, ASP Script or PHP script etc. The back-end application will perform required processing on the passed data based on defined business logic inside the application.The tag is used in HTML to create a form and various form element like input, textarea, etc is included in ... Read More

HTML DOM Anchor Object

AmitDiwan
Updated on 17-Sep-2019 09:01:23

201 Views

The element is used in HTML to create hyperlinks along with href attribute. The anchor object represents this element.ExampleIn the below example, we will learn how to access an anchor object − Live Demo Demo Heading Google Display the link Link gets displayed here    function display() {       var a = document.getElementById("myid").href;       document.getElementById("demo").innerHTML = a;    } OutputThis will produce the following output −

HTML DOM Anchor Hostname Property

AmitDiwan
Updated on 17-Sep-2019 08:58:40

141 Views

The HTML DOM Anchor hostname property returns only the hostname of the URL. It returns the domain name.SyntaxFollowing is the syntax to set the hostname property −anchorObj.hostname = hostnameAbove, the hostname is the hostname of the URL.SyntaxFollowing is the syntax to return the hostname property −anchorObj.hostnameExampleLet us now see an example to implement the DOM Anchor hostname property − Live Demo Company Our Team Display Anchor Part Display Host Part Display Hostname    function display() {       var a = document.getElementById("mylink").hash;       document.getElementById("myid").innerHTML = a;    }    function display2() {     ... Read More

Use of Object.assign in JavaScript

Ayush Gupta
Updated on 17-Sep-2019 08:55:08

305 Views

The Object.assign() method is used to copy the values of all of the object's own properties(enumerable only) from one or more source objects to a target object. It will return the target object.Exampleconst targetObj = { a: 1, b: 2 }; const sourceObj = { b: 4, c: 5 }; const returnedTarget = Object.assign(targetObj, sourceObj); console.log(targetObj); console.log(returnedTarget); console.log(returnedTarget === targetObj); console.log(sourceObj);Output{ a: 1, b: 4, c: 5 } { a: 1, b: 4, c: 5 } true { b: 4, c: 5 }Note −sourceObj did not change.returnedTarget and targetObj are the same.The Object.assign() method only copies enumerable and own properties from ... Read More

Eradicating Memory Leaks in JavaScript

Ayush Gupta
Updated on 17-Sep-2019 08:15:58

211 Views

The main cause for leaks in garbage collected languages are unwanted references. To understand memory leaks, let us see how the memory freeing(garbage collection) works.Mark-and-sweep algorithm −This algorithm reduces the definition of "an object is no longer needed" to "an object is unreachable". This algorithm assumes the knowledge of a set of objects called roots. In JavaScript, the root is the global object. Periodically, the GC starts from these roots, find all objects that are referenced from these roots, recursively. Starting from the roots, the GC will thus find all reachable objects and collect all non-reachable objects.Types of memory leaks1. ... Read More

HTML a Href Attribute

AmitDiwan
Updated on 17-Sep-2019 08:14:27

378 Views

The href attribute is used to set the link i.e. the URL of the page.SyntaxFollowing is the syntax −Above, URL is the url you need to mention, which can be a relative link, absolute link, script, protocol, etc.ExampleLet us now see an example to implement the href attribute of the element − Live Demo Learning is Fun Learn the concepts of Java! Also try JavaScript from our website: JavaScript! OutputThis will produce the following output −ExampleLet us see another example wherein we can set the email-id of a user with a href − Live ... Read More

Avoid Circular Reference in OOP JavaScript

Ayush Gupta
Updated on 17-Sep-2019 08:05:54

513 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

Advertisements