Found 8591 Articles for Front End Technology

Check if the given two numbers are friendly pairs or not

Divya Sahni
Updated on 25-Jul-2023 12:25:24

1K+ Views

Friendly Numbers − According to number theory, friendly numbers are two or more numbers having the same abundancy index. Abundancy Index − Abundancy index of a natural number can be defined as the ratio between the sum of all the divisors of the natural number and the natural number itself. The abundancy of a number n can be expressed as $\mathrm{\frac{\sigma(n)}{n}}$ where $\mathrm{\sigma(n)}$ denotes the divisor function equal to all the divisors of n. For example, the abundancy index of the natural number 30 is, $$\mathrm{\frac{\sigma(30)}{30}=\frac{1+2+3+5+6+10+15+30}{30}=\frac{72}{30}=\frac{12}{5}}$$ A number n is said to be a ‘friendly number’ if there exists a ... Read More

Max occurring divisor in an interval

Divya Sahni
Updated on 25-Jul-2023 12:06:49

196 Views

Let x and y be two numbers. In this case, x is said to be a divisor of y if when y is divided by x it returns zero remainder. The maximum occurring divisor in an interval is the number that is a divisor of the maximum number of elements of that interval. Problem Statement Given an interval [a, b]. Find the maximum occurring divisor in the range including both a and b, except ‘1’. In case all divisors have equal occurrence, return 1. Sample Example 1 Input [2, 5] Output 2 Explanation − Divisors of 2 = ... Read More

Ramanujan–Nagell Conjecture

Divya Sahni
Updated on 25-Jul-2023 11:38:12

186 Views

Ramanujan-Nagell Equation is an example of the exponential Diophantine equation. The diophantine equation is a polynomial equation with integer coefficients of two or more unknowns. Only integral solutions are required for the Diophantine equation. Ramanujan-Nagell Equation is an equation between a square number and a number that is seven less than the power of 2, where the power of 2 can only be a natural number. Ramanujan conjectured that the diophantine equation 2y - 7 = x2 has positive integral solutions and was later proved by Nagell. $$\mathrm{2y−7=x^2\:has\:x\epsilon\:Z_+:x=1, 3, 5, 11, 181}$$ Triangular Number − It counts objects arranged in ... Read More

How TypeScript works internally?

Rushi Javiya
Updated on 01-Aug-2023 16:35:22

1K+ Views

TypeScript is a strongly-typed programming language that builds upon the syntax of JavaScript. It was created by Microsoft and was released in 2012. TypeScript is designed to make large-scale JavaScript applications more manageable and easier to maintain by adding features such as type annotations, interfaces, and classes. In this article, we will explore how TypeScript works internally. We will look at its architecture, type-checking, and compilation process. Overview of TypeScript TypeScript adds new syntax features to JavaScript but also maintains compatibility with the existing JavaScript code. TypeScript source code is compiled into plain JavaScript code that can be run on ... Read More

How to remove Time from Date TypeScript?

Rushi Javiya
Updated on 04-Sep-2023 11:56:42

23K+ Views

When working with date objects in TypeScript, sometimes it's necessary to extract only the date and remove the time component from it. This can be useful when displaying dates in a user interface or comparing dates. In this tutorial, we will explore several ways to remove time from date in TypeScript. Syntax const dateWithoutTime = date.toLocaleDateString(); const dateWithoutTime = date.toISOString().split('T')[0]; The above is the syntax of two different typescript methods for removing time from date. The first method uses the toLocaleDateString() method. The second method uses this string () method. Example 1: Using the toLocaleDateString() Method const date = ... Read More

Any and Object in Typescript

Rushi Javiya
Updated on 04-Sep-2023 11:46:21

4K+ Views

TypeScript is a powerful, statically typed superset of JavaScript that brings additional features and advantages to JavaScript development. Two commonly used types in TypeScript are any and object. In this tutorial, we will delve into the concepts of any and object in TypeScript and explore how they can be used in various scenarios. We will provide clear syntax explanations, code examples, and their corresponding outputs to help beginners grasp these concepts effectively. The any Type The any type is a special type in TypeScript that allows variables to hold values of any type. It provides flexibility by bypassing static type ... Read More

Show Data Using Text Box in TypeScript

Rushi Javiya
Updated on 04-Sep-2023 10:37:29

3K+ Views

Data representation is crucial in software development, and it is essential to present data in a user-friendly way with the increasing demand for web-based applications. Text boxes are one of the ways to do so. Text boxes provide an easy way to display data to users in a structured and presentable way. This tutorial will provide a comprehensive guide on using text boxes in TypeScript to show data effectively. We will cover what text boxes are, provide syntax and algorithms for working with text boxes, and give multiple examples to illustrate how to use text boxes. What are Text Boxes ... Read More

Why You Should Use TypeScript for Developing Web Applications?

Rushi Javiya
Updated on 04-Sep-2023 10:35:03

235 Views

TypeScript is a superset of JavaScript that includes all the features of JavaScript and more. It provides additional features like static typing, interfaces, classes, and modules to help developers write more robust and maintainable code. In this article, we will discuss why you should use TypeScript for developing web applications and how it can benefit you, with examples. Static Typing One of the primary benefits of TypeScript is static typing. Static typing means variables, function parameters, and function return types must be defined before the code is compiled. This makes it easier for developers to catch errors before the code ... Read More

How to Use Lambda Expression in TypeScript?

Rushi Javiya
Updated on 04-Sep-2023 10:32:03

9K+ Views

Lambda expressions offer a succinct and expressive means of defining functions in TypeScript and are versatile enough to be utilized as class methods, object properties, and callbacks in higher-order functions. This tutorial aims to delve into the syntax of lambda expressions, highlight their advantages over conventional functions, and provide guidance on how to use lambda expressions in TypeScript effectively. What are Lambda Expressions? Lambda expressions, commonly referred to as arrow functions, were first introduced in ECMAScript 6 and have gained widespread usage in contemporary JavaScript and TypeScript code. These expressions provide a succinct syntax for defining functions in both languages. ... Read More

How to Create a Combined Child Selector in SASS?

Ayushya Saxena
Updated on 19-Jul-2023 11:53:23

247 Views

Systematically Awesome Style Sheets, or Sass, is an extension to the core CSS language that performs the role of a pre-processor. Its main goal is to enhance CSS with more advanced features and a more sophisticated look. Sass gives developers the ability to use a completely CSS-compatible syntax by permitting the use of variables, nested rules, mixins, inline imports, inheritance, and other capabilities. Sass positions itself as a very strong and effective extension language for CSS, expertly defining the style of documents in a thorough and organised way. Its fundamental value comes from its capacity to manage large style sheets ... Read More

Advertisements