![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 9326 Articles for Object Oriented Programming
![Nikitasha Shrivastava](https://www.tutorialspoint.com/assets/profiles/655298/profile/60_3988199-1684213136.jpeg)
354 Views
In the given problem statement we are presented with an array which contains positive and negative values. So our task is to keep the positive once and filter out the negative numbers from the array. And implement the solution in Javascript. Understanding the Problem We will be given an array of integer numbers and we need to find the positive integers which have their respective negative integers present in the array. For example suppose we have an array of integers like [7, -7, 8, -8, 9, -9], in this array we can see that their is some positive ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
145 Views
We are required to write a JavaScript function that takes in a Number as the only input. The function should do one simple thing −keep adding the resultant digits until they converse to a single digit number.For example −const num = 5798;i.e.5 + 7 + 9 + 8 = 29 2 + 9 = 11 1 + 1 = 2Hence, the output should be 2ExampleThe code for this will be −const num = 5798; const sumDigits = (num, sum = 0) => { if(num){ return sumDigits(Math.floor(num / 10), sum + (num % 10)); }; return sum; }; const repeatSum = (num) => { if(num > 9){ return repeatSum(sumDigits(num)); }; return num; }; console.log(repeatSum(num));OutputAnd the output in the console will be −2
![Nikitasha Shrivastava](https://www.tutorialspoint.com/assets/profiles/655298/profile/60_3988199-1684213136.jpeg)
527 Views
In the given problem statement, our task is to sort an integer number without the usage of string methods and without usage of arrays with the help of Javascript functionalities. So for solving this task we will use mathematical operations and loops in Javascript. Understanding the Problem The problem says to sort the given integer number without using the string and array method in Javascript. The question arises about sorting the integer that means we have to array its digits in ascending or descending order. For example suppose we have an integer number as 784521, so ... Read More
![Nikitasha Shrivastava](https://www.tutorialspoint.com/assets/profiles/655298/profile/60_3988199-1684213136.jpeg)
1K+ Views
In the given problem statement we are presented with a digit and our task is to split it into individual digits with the help of Javascript. So we can convert the given number into a string and then we can use it in string manipulation techniques to get the desired result. Understanding the Problem In Javascript, it is very common to manipulate numbers at the individual digit level. So this is a common task to split the given number into its constituent digits. And extract it for further process or analysis. Logic for the given Problem ... Read More
![Nikitasha Shrivastava](https://www.tutorialspoint.com/assets/profiles/655298/profile/60_3988199-1684213136.jpeg)
472 Views
In the given problem statement we are presented with an array which contains multiple subarrays. So our aim is to compute the average of every individual subarray and store these averages in a new array. And implement the solution in Javascript. Understanding the problem The problem has given an array which contains multiple arrays or nested arrays. Every subarray contains some numerical values. Our task is to compute the average of every subarray and collect these averages into a new array. For example we have arrays like this [[4, 6], [2, 4], [6, 2]] so the average of ... Read More
![Nikitasha Shrivastava](https://www.tutorialspoint.com/assets/profiles/655298/profile/60_3988199-1684213136.jpeg)
389 Views
In the given problem statement we are presented with a singly linked list and our task is to remove one element from the list. So we will discuss this operation step by step below. What is a singly Linked List ? A singly linked list consists of a series of nodes. It is a type of data structure. In this every node contains a value or we can say data and the list to the next node in the sequence. The first node in the list is called the head and the last node in the list points ... Read More
![Nikitasha Shrivastava](https://www.tutorialspoint.com/assets/profiles/655298/profile/60_3988199-1684213136.jpeg)
1K+ Views
Our aim in the given problem statement is to find all the possible pairs which sum to a given target value with the help of Javascript. So we can solve this problem with the help of some built-in functions of Javascript. Understanding the Problem The given problem is stating that we have given an array and a target value and our task is to find all the possible pairs that sum to the target value. For example suppose we have an array like [6, 5, 4, 3, 2, 1] and the target value is 6 so the possible ... Read More
![Nikitasha Shrivastava](https://www.tutorialspoint.com/assets/profiles/655298/profile/60_3988199-1684213136.jpeg)
230 Views
Our goal in the above problem statement is to use Javascript functionalities and determine whether or not the given arrays are subsets of each other. So using loops we can fix this problem. Understanding the problem The problem description specifies that we have to identify that the given array is a subset of another array. Or we have to check that all of the items in the second array are present in the first array. For example, suppose we have an array like ['a', 'b', 'c', 'd', 'e'] and a second array ['b', 'd', 'e']. So when we ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
494 Views
In this problem statement, our target is to add two binary arrays with the help of Javascript. So we will break down the problem step by step to ensure understanding. What is the Binary array ? A binary array is an array that represents a binary number. In a binary number system we have only two possible digits, 0 and 1. The binary array will have the elements which can only be 0s and 1s. Every item in the array will represent a bit of the binary number. For example we have a binary array [1, ... Read More
![Nikitasha Shrivastava](https://www.tutorialspoint.com/assets/profiles/655298/profile/60_3988199-1684213136.jpeg)
194 Views
In this problem statement, our target is to get the chunking array within the array with the help of Javascript functionalities. So basically we will divide an array into smaller arrays. What is the meaning of Chunking array within an array ? Chunking an array means arranging the array items in smaller subarrays of the same size. Or we can say that chunking an array within an array refers to the process of dividing the large size array into the smaller subarrays or chunks. So the items of the original array are arranged together into the nested arrays ... Read More