Arnab Chakraborty has Published 4293 Articles

C++ Program to Round a Number to n Decimal Places

Arnab Chakraborty

Arnab Chakraborty

Updated on 17-Oct-2022 12:11:09

25K+ Views

Representing numbers in outputs is an interesting and also important task while we are writing programs in any language. For integer type (short, long, or medium) type data, it is easy to express the numbers as output. For floating point numbers (float or double type), sometimes we need to round ... Read More

C++ Program to Calculate simple interest and compound interest

Arnab Chakraborty

Arnab Chakraborty

Updated on 17-Oct-2022 09:22:53

26K+ Views

After calculating interest on the principal amount, simple interest is calculated by taking the principal amount, the rate of interest, and the number of years it will take to calculate interest. The formula is quite easy to understand. The power law is used to calculate compound interest by taking into ... Read More

What is an anonymous function in JavaScript?

Arnab Chakraborty

Arnab Chakraborty

Updated on 23-Aug-2022 08:13:53

2K+ Views

Like other advanced languages, JavaScript also supports anonymous functions. From the word anonymous, it is clear that when a function has no identifier or no name, that function is called an anonymous function. The only difference between anonymous function and normal function is that normal function has names but anonymous ... Read More

What is the syntax to define enums in javascript?

Arnab Chakraborty

Arnab Chakraborty

Updated on 23-Aug-2022 08:09:44

15K+ Views

Enums or Enumerated types are special data types that set variables as a set of predefined constants. In other languages enumerated data types are provided to use in this application. Javascript does not have enum types directly in it, but we can implement similar types like enums through javascript. In ... Read More

What is javascript version of sleep()?

Arnab Chakraborty

Arnab Chakraborty

Updated on 23-Aug-2022 07:59:27

791 Views

Sometimes we perform certain tasks in any language by maintaining a time delay. For instance, we are making a timer application that will update each second. In such cases, we wait for a second and update the second timer one by one. We also call this delay or sleep().In some ... Read More

How to pretty print json using javascript?

Arnab Chakraborty

Arnab Chakraborty

Updated on 23-Aug-2022 07:54:16

960 Views

Java Script Object Notation is one of the many standard formats to store data in different many applications. JavaScript objects can also be stored in a file in this JSON format. In this article, we will cover a few methods to print the JSON objects in a pretty method. Let ... Read More

How to return the response from an asynchronous call in Javascript?

Arnab Chakraborty

Arnab Chakraborty

Updated on 23-Aug-2022 07:33:53

443 Views

Asynchronous programming is fairly common in javascript network programming. In this approach, we can download, or perform some time-dependent jobs without locking thecurrent execution flow. Which performs asynchronously as compared to our program, which can be done using async functions in javascript. In this article, we will discuss the techniques ... Read More

Mixins in JavaScript

Arnab Chakraborty

Arnab Chakraborty

Updated on 23-Aug-2022 07:22:32

3K+ Views

Multiple-inheritance is not supported by Javascript by default. But sometimes we need to mix multiple object properties into a single object. Object property sharing can be done using mixins. In this article, we shall cover what are mixins in JavaScript. The definition of mixins can be stated as mixins is ... Read More

How to make your code faster using JavaScript Sets?

Arnab Chakraborty

Arnab Chakraborty

Updated on 23-Aug-2022 07:20:29

1K+ Views

While writing code, we always try to make our code easier to read, less complex, more efficient, and smaller in size. For that, we follow several methodologies which make our code efficient. In this article, we shall focus on some techniques based on Javascript sets to perform certain array-like or ... Read More

How to know whether a value is searched in Javascript sets?

Arnab Chakraborty

Arnab Chakraborty

Updated on 23-Aug-2022 06:54:47

169 Views

In javascript, we may use some sets to hold a few objects. Sometimes we want to check whether an element is present inside a set or not. In this article, we will see different techniques to check whether an element is inside a given set or not.p> A trivial method ... Read More

Advertisements