RTRAJAI TARUNinrajaitarun.hashnode.dev·Feb 13, 2024 · 3 min readMastering React. Lecture 04Aim : Understanding the flow and structure. Creating a custom react Setup a folder with a js file and html file Select the div in customReact.js Now lets say we want to render a anchor tag. So, lets create a object named reactElement having i...00
RTRAJAI TARUNinrajaitarun.hashnode.dev·Mar 8, 2023 · 1 min readDOM NotesFull form: Document Object Model Selection methods: let id = document.getElementById("idName"); let class = document.getElementsByClassName("className"); let tag = document.getElementsByTagName("tagName"); id.innerText = "Hi there"; (changing th...00
RTRAJAI TARUNinrajaitarun.hashnode.dev·Feb 8, 2023 · 1 min readWrite a program to find second largest number in an array.Solution : Algorithm : Find the maximum number of the array. Replace the maximum number with the smallest integer value. Find the maximum again. import java.util.Scanner; public class secondMax { static int findMax(int [] arr){ int ...00
RTRAJAI TARUNinrajaitarun.hashnode.dev·Feb 8, 2023 · 1 min readFind the unique number in an arrayFind the unique number in an array where all the elements are repeated twice. All the numbers are positive. Answer : Let array be Arr = [1,2,3,4,2,1,3]; Here the number 4 is unique and all other numbers are being repeaated twice. So, we will traverse...00
RTRAJAI TARUNinrajaitarun.hashnode.dev·Jan 22, 2023 · 1 min readJava snippet to find factorial of a numberFind factorial :- int factorial = number; for (int i = number - 1; i > 0; i--) { factorial = factorial * i; } System.out.println(factorial);00