Convert Infinity to String in JavaScript

Shubham Vora
Updated on 02-Aug-2022 09:52:54

703 Views

This tutorial will teach us how to convert the infinity to string in JavaScript. The Infinity is the reserved keyword in JavaScript and demonstrates the concept of the infinity number of mathematics. It is a global variable, and we can access it anywhere in our program. Here, we have two approaches to converting the infinity number to a string in JavaScript. Using the String() Constructor Using the toString() Method Using the String() Constructor The JavaScript contains the class for the variable of every data type and its related method. It also contains the string class and which is ... Read More

Are JavaScript Functions Object Methods?

Shubham Vora
Updated on 02-Aug-2022 09:47:35

217 Views

Compared to other languages, JavaScript works differently, especially if you get confused between function and methods. In this tutorial, we will learn whether JavaScript functions are object methods. The example written in this tutorial gives you a better idea about the differences and which one is more convenient for us. What are JavaScript Functions? Functions are generally used to define a particular task that we want to perform. It is a set of instructions, and every function has its block of code. Functions can also have parameters by performing desired operations on those parameters. Syntax The syntax for the ... Read More

Convert JavaScript Date to UTC

Shubham Vora
Updated on 02-Aug-2022 09:41:10

14K+ Views

In this tutorial, we will learn to convert the date to UTC. The full form of the UTC is the universal time coordinate, and it is a standard time that is considerable in every country. Let’s understand the need to convert the date to UTC by example. You have created the chat application. Users from various countries are using your application. Suppose that one user is from the USA and another from India. Both have a different time zone. So, you can either show the user to message received or send time in the local time or the UTC. There ... Read More

Stop a YouTube Video with JavaScript

Shubham Vora
Updated on 02-Aug-2022 09:20:06

10K+ Views

In this tutorial, we will learn to stop a video with JavaScript on YouTube. Using the ‘iframe’ HTML element, we can easily embed the YouTube videos on our application. It is a video player in HTML 5 and has many attributes that users can use according to their needs. In some cases, it happens that you want to create a custom pause or stop button for the embedded YouTube video. Customized buttons are always pretty rather than default ones, making UI pretty. So, we will learn two different methods to create the custom stop button for the YouTube videos. However, ... Read More

Calculate the Sum of Natural Numbers in Swift

Ankita Saini
Updated on 01-Aug-2022 14:43:13

964 Views

This tutorial will discuss how to write a swift program to calculate the Sum of Natural Numbers. Natural numbers are the set of whole numbers excluding 0. In other words, natural numbers are the numbers which includes all the positive numbers starting from 1 to infinity. It does not contain negative numbers and 0 in it. For example 2, 3, 67, 49, etc. They are also known as counting numbers. We can find the sum of natural numbers by adding given natural numbers using arithmetic addition operator (+). For example, we have 8 so the sum of natural numbers is ... Read More

Find Surface Area and Volume of Cuboid in Swift

Ankita Saini
Updated on 01-Aug-2022 14:36:37

923 Views

This tutorial will discuss how to write a swift program to find the surface area and volume of cuboid. A Cuboid is a 3-dimensional solid figure which contains six rectangular faces, eight vertices and twelve edges. It has three dimensions known as length, breadth, and height and if a cuboid has integer edges then the cuboid is the perfect cuboid. The opposite edges of the cuboid are always parallel to each other and the angle formed by all vertices are 90 degrees Surface area of cuboid Surface area of a cuboid is the total space occupied by the cuboid. ... Read More

Check If a Number is a Neon Number in Swift

Ankita Saini
Updated on 01-Aug-2022 13:16:46

255 Views

This tutorial will discuss how to write a swift program to check whether the input number is a Neon Number. In a number system, a number whose sum of digits of square of the number is equal to the number is known as neon number. Below is an example of the neon numbers − Let’s see if number 9 is a neon number or not? - The square of 9 is 81 and the sum of 81 is 9 So 9 is a neon number Let’s take another example - 15 The entered number is not a neon number Here, ... Read More

Calculate Compound Interest in Swift

Ankita Saini
Updated on 01-Aug-2022 13:06:01

849 Views

This tutorial will discuss how to write a swift program to calculate compound interest. The interest applied to the principal and interest together over a certain period of time is known as compound interest. In other words, the compound interest is known as the interest on interest. It is calculated after calculating the amount. Formula Following is the formula of compound interest − Amount(A) = Principal(P)(1 + Rate/100)Time(t) C.I = Amount(A) - Principal(P) Where Principal(P) − Principal amount represents the amount that is initially invested. Rate(R) − Rate represents the interest rate, that applied to the principal amount for the ... Read More

Generate Multiplication Table in Swift

Ankita Saini
Updated on 01-Aug-2022 12:43:54

1K+ Views

This tutorial will discuss how to write a Swift program to generate Multiplication Table. A multiplication table is a list or table of multiples of a specified number. We can create a multiplication table by multiplying a number with whole numbers. Generally, a multiplication table is created upto 10 times but you can create it according to your need. Below is a demonstration of the same − Suppose our given input is − The desired output is − Following is the multiplication table is 9 9 * 1 = 10 9 * 2 = 20 9 * 3 ... Read More

Calculate Power of a Number in Swift

Ankita Saini
Updated on 01-Aug-2022 09:26:18

2K+ Views

This tutorial will discuss how to write a swift program to calculate the power of a number. Power of a number means how many times a number is used in multiplication, for example, 16 ^2 = 16 * 16 = 256 or 16 to the power of 2. It is also known as exponent or indices. Below is a demonstration of the same − Suppose our given input is − Number - 16 Exponent Value is - 3 The desired output is − Final result is 16^3 = 4096 Calculating power of a number using recursion We can calculate the ... Read More

Advertisements