ABAYTHON

f-strings in Python

Python f-strings or formatted strings are new way of formatting strings introduced in Python 3.6 under PEP-498. It’s also called literal string interpolation. They provide a better way to format strings and make debugging easier too. What are f-strings? Strings in Python are usually enclosed in “ ” (double quotes) or ‘ ‘ ( single …

f-strings in Python Read More »

getter and setter

What are getter and setter methods in JavaScript?

Before jumping into getter and setter. There are two kinds of object properties in JavaScript: data properties and accessor property Data property: Example of data property, Accessor property: Accessor properties are functions that execute on getting and setting a value of an object. Accessors are useful when some operations are needed to be performed automatically …

What are getter and setter methods in JavaScript? Read More »

arrow function

Arrow function in JavaScript

Arrow functions expression is an alternative to traditional function expression. They are similar to lambda functions in python. These functions are often used in passing a function as a parameter to higher order functions. It is one of the features introduced in ES6. The function , Can be written as Syntax: myFunction – name of …

Arrow function in JavaScript Read More »

closure in javascript

Closure in JavaScript

The closure is an important concept in functional programming. Closure means that an inner function always has access to the vars and lets of outer function, even after the function has returned. It is a form of lexical scoping. A closure is the combination of a function bundled together (enclosed) with references to its surrounding …

Closure in JavaScript Read More »

async await in javascript

Async/await in JavaScript

Async/await is an extension of promise. We use async keyword with a function to represent that the function is asynchronous. The async function returns a promise. It is also possible to use await keyword inside a async function. Javascript async keyword: Syntax: name – name of function parameter- parameter that are passed Example: Output: Async function. …

Async/await in JavaScript Read More »