Scroll to the Top of the Page Using JavaScript and jQuery

Anjana
Updated on 16-Jun-2020 08:16:43

279 Views

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

Align Single Rows of Items at the End in Bootstrap 4

Amit Diwan
Updated on 16-Jun-2020 08:16:01

261 Views

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  

Difference Between Getter and Setter in JavaScript

Akshaya Akki
Updated on 16-Jun-2020 08:15:05

984 Views

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

Z Algorithm

Sharon Christine
Updated on 16-Jun-2020 08:13:31

409 Views

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

Delete a Setter using the Delete Operator in JavaScript

Manikanth Mani
Updated on 16-Jun-2020 08:12:18

252 Views

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

Define Getter and Setter Functions in JavaScript

Ayyan
Updated on 16-Jun-2020 08:11:42

318 Views

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

Latest Operators Added to JavaScript

Ayyan
Updated on 16-Jun-2020 08:10:14

128 Views

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

Bootstrap Popover Event

Amit Diwan
Updated on 16-Jun-2020 08:09:13

2K+ Views

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

Usage of Rest Parameter and Spread Operator in JavaScript

Anjana
Updated on 16-Jun-2020 08:08:19

352 Views

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

How Python Class Inherits Objects

Rajendra Dharmkar
Updated on 16-Jun-2020 08:06:50

207 Views

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

Advertisements