JavaScript Math expm1() function

expm1() is defined in Math. It is a static method and you can call it directly like Math.expm1(). It takes one number as the argument and returns e^n - 1, where n is the provided number. That means, its value is equal to Math.exp(n) - 1.

Read

JavaScript program to find all years in a range with first January Monday

In this JavaScript program, we will learn how to find all years in a range with first January as Monday. With this program, you will learn how to use a loop in JavaScript and how to check the current day using Date constructor.

Read

How to do run-time type checking in Dart

If we are not declaring the type of a variable, we can assign any type to it. The compiler will not throw any error. Only in run-time, we will get type-mismatched.

Read

What are mixins in Dart

Dart 2.1 introduced one new concept called mixins. In simple words, this is a class that contains methods that can be used by other classes. So, don't we have already inheritance ? We can extend one class, right ? We can have one abstract class and extend it. So, why mixins ?

Read

Generics in Dart explanation with example

Generic is a concept to use different types of values with a single type of definition. For example, we can create different types of lists in dart like List is for a string list, List is for an integer list etc. Here, List is a generic type. If you check its definition, you will see that it is defined as List. Here, E letter stands for element. By convention letter E, T, S, K and V are used for generic. For example, map class is defined as Map<K, V>.Map, Set, List and Queue are examples of generic implementation.

Read

Enumeration in Dart explanation with example

Enumeration is an user defined list of constants values. This is a class and also known as enums or enumerated types. Enums are normally used in switch-case blocks. If you are familiar with enums in any other programming languages like Java, enums in Dart is similar to that.

Read

JavaScript program to find the nearest number in an array

Our problem is to find the nearest number in an array specific to a given number. For example, if our array is [1,5,10,15,20] and if the given number is 18, the output of the program should be 20 as this is the nearest number to 18 in this array. Again, if the number is 16, it will print 15. Note that we are checking in both ways to find the nearest number.

Read

JavaScript program to find the largest of five numbers

In this tutorial, I will show you four different ways to find out the largest of five numbers using JavaScript. You can use these approaches to find out the largest of any n numbers. Let's move to the examples :.

Read

Python modulo explanation with example

Python modulo explanation with example

Read

Implicit interface in Dart with examples

Dart doesn't have any interface keyword to define an interface. In Dart, each class implicitly defines an interface. This interface holds all the instance members of the class and of any other classes it implements.

Read