Here, we will learn to swap the key and value of the JSON element using JavaScript. In JavaScript, an object stores the key-value pairs. So, we can swap the key and value as we swap two normal variables. In this tutorial, we will learn different approaches to swapping all the key values of JSON elements using JavaScript. Use the for loop We can iterate through the keys of the JSON object using for loop. After that, we can access the value from the object using the key. So, we can swap every key and value in the object. ... Read More
Sometimes, we require to get all the dates between the given date range. In this tutorial, we will take two dates and find all dates between two dates. Also, we will store all dates in the array. Here, we will learn three approaches to storing all dates in an array present between given two dates in JavaScript. Use the while loop and setDate() method We can use the while loop for iteration and the setDate() method to set dates in the date object. On every iteration of the while loop, we can increase the date by one ... Read More
Sometimes, we require to map keys to particular values using some data structure in JavaScript. For example, storing the user details in the key value pairs in JavaScript is useful. We can use different data structures, such as objects or maps in JavaScript, to store data in the key-value format. Use the objects to store a key => value in JavaScript In JavaScript, objects allow us to store data in the key-value format. We can use the key with the object to get the data from the object. Syntax Users can follow the syntax below to use ... Read More
Stopping the browser’s back button meaning is that preventing users from going to the previous page. Sometimes, we need to prevent users from going to the back of the current page for security purposes. For example, most bank sites don’t allow you to go back when you are doing some transaction from their site using online banking. Because if users go back from the midtransaction, it can create some issues. So, it only allows you to either complete the transaction or cancel the transaction and start it again. Here, we will learn various approaches to prevent users from going ... Read More
The Project Management Office (PMO), a division or group inside a non-governmental organization (NGO), maybe in charge of overseeing and coordinating all of the projects and activities that the NGO manages. The PMO may be responsible for a variety of duties according to the demands of the NGO, but some common ones are as follows − Creating Project Plans and Schedules − The PMO is in charge of drafting thorough project plans that describe the scope, objectives, budget, and resources required for each project. They also set deadlines for every project and keep track of development to guarantee ... Read More
It's possible that new approaches, technology, and trends that have recently evolved will be incorporated into the definition of project management in 2023. Listed below are a few scenarios in which the definition of project management might alter in 2023 Increased emphasis on digitalization − As technology develops, project management will probably become more digital. This may involve using automation, AI, and big data analytics to boost productivity and decision-making. An increased focus on remote work − As more businesses adopt rules for remote work, project management will need to change to successfully manage remote teams. This can involve ... Read More
A matrix is an arrangement of numbers in rows and columns. Matrix can be of various type like square matrix, horizontal matrix, vertical matrix etc. So here we print the right diagonal of square matrix. Square matrix is a matrix in which the number of rows and columns are same. For example 3x3, 5x5, 7x7, etc. In this article, we will learn how to write a swift program to print the right diagonal matrix. Algorithm Step 1 − Create a function. Step 2 − Run for-in loop to iterate through each element of the matrix. Step 3 − Check for ... Read More
In this article, we will learn how to write a swift program to print the left diagonal matrix. A matrix is an arrangement of numbers in rows and columns. Matrix can be of various type like square matrix, horizontal matrix, vertical matrix etc. So here we print the left diagonal of square matrix. Square matrix is a matrix in which the number of rows and columns are same. For example 3x3, 5x5, 7x7, etc. Algorithm Step 1 − Create a function. Step 2 − Run for-in loop to iterate through each element of the matrix. Step 3 − Check ... Read More
A number is a perfect cube if the result of the three time multiplication of a whole number is the number itself. For example: number 5 is a per Number = 125 125 = 5*5*5 Here 125 is a perfect cube. Number = 98 Here 98 is not a perfect cube. In this article, we will learn how to write a swift program to check whether a number is a perfect cube or not. Method 1: Using user defined function To check if the given number is a perfect cube or not, we create a function that check each number ... Read More
A perfect number is a positive number that is equal to the sum of its factors, excluding the number itself. For example − Number = 6 Proper divisors = 1, 2, 3 Hence, 6 is the perfect number because the sum of its divisors is 6(1+2+3) Number = 10 Proper divisors = 1, 2, 5 Hence, 10 is not a perfect number because the sum of its divisors is 8(1+2+5) In this article, we will learn how to write a swift program to check if the given number is a perfect number or not. Algorithm Step 1 − Create ... Read More