ExampleLive Demo $("a").click(function() { $("html, body").animate({ scrollTop: 0 }, "slow"); return false; }); TOP OF PAGE This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is ... Read More
To align single rows of items at the end, use the .align-items-end class in Bootstrap 4.Align using the align-items-end class −Now add the flex items to align single rows of items − Product 1 Product 2 Product 3 Let us see an example to align single rows of items at the end −ExampleLive Demo Bootstrap Example Align Flex Items on a single row at the end Product 1 Product 2 Product 3 Product 4
GetterWhen a property is accessed, the value gets through calling a function implicitly. The get keyword is used in JavaScript. An identifier, either a number or a string is allowed for set.SetterWhen a property is set, it implicitly calls a function and the value is passed as an argument. With that, the return value is set to the property itself. The set keyword is used in JavaScript. An identifier, either a number or a string is allowed for set.ExampleHere’s an example showing how to implement both getter and setterLive Demo ... Read More
This algorithm is named Z Algorithm because, in this algorithm, we need to create a Z array. The size of the Z array is the same as the text size. This array is used to store the length of longest possible substring starting from the current character of the main string. At first, the pattern and the main text are concatenated with a special symbol which is not present in the text and pattern. If the P is pattern and T is the main text, then after concatenation, it would be P$T (Assuming $ is not present in the P ... Read More
To delete a setter using the delete operator, use the delete keyword. Here’s how you can delete −delete obj.nameExampleYou can try to run the following code to learn how to delete a setterLive Demo var department = { deptName: "Marketing", deptZone: "North", deptID: 101, get details() { return "Department Details" + "Name: " + this.deptName + " Zone: " ... Read More
GetterWhen a property is accessed, the value gets through calling a function implicitly. The get keyword is used in JavaScript. An identifier, either a number or a string is allowed for set.SetterWhen a property is set, it implicitly call a function and the value is passed as an argument. With that the return value is set to the property itself. The set keyword is used in JavaScript. An identifier, either a number or a string is allowed for set.ExampleHere’s an example showing how to implement both getter and setterLive Demo ... Read More
The latest operators added to JavaScript are spread operator and rest.Rest operatorWith rest parameter, you can represent number of arguments as an array. ES6 brought rest parameter to ease the work of developers. For arguments objects, rest parameters are indicated by three dots … and preceds a parameter.ExampleLet’s see the following code snippet to define rest parameter function addition(…numbers) { var res = 0; numbers.forEach(function (number) { res += number; ... Read More
The shown.bs.popover event fires when the popover is completely visible.Firstly, display the popover on button click using the following code −$(".btn-default").click(function(){ $("[data-toggle='popover']").popover('show'); });After that, fire the popover shown.bs.popover event and generate alert −$("[data-toggle='popover']").on('shown.bs.popover', function(){ alert('Popover is completely visible!'); });You can try to run the following code to implement the show.bs.popover event −ExampleLive Demo Bootstrap Example Awards Here's the list: List ... Read More
Rest ParameterWith rest parameter, you can represent a number of arguments as an array. ES6 brought rest parameter to ease the work of developers. For arguments objects, rest parameters are indicated by three dots … and precedes a parameter.Let’s see the following code snippet to define rest parameter − function addition(…numbers) { var res = 0; numbers.forEach(function (number) { res += number; }); ... Read More
In Python 2.x there are two styles of classes depending on the presence or absence of a built-in type as a base-class −‘Old style’ or "Classic" style classes: they have no built-in type as a base class −>>> class OldFoo: # no base class ... pass >>> OldFoo.__bases__ ()"New" style classes: they have a built-in type as a base class meaning that, directly or indirectly, they have object as a base class −>>> class NewFoo(object): # directly inherit from object ... pass >>> NewFoo.__bases__ (, )In Python 3.x however, only ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP