Mastering 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...Feb 13, 2024 · 3 min readrajaitarun.hashnode.dev
DOM 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...Mar 8, 2023 · 1 min readrajaitarun.hashnode.dev
Write 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 ...Feb 8, 2023 · 1 min readrajaitarun.hashnode.dev
Find 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...Feb 8, 2023 · 1 min readrajaitarun.hashnode.dev
Java 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);Jan 22, 2023 · 1 min readrajaitarun.hashnode.dev