What are Children Props in React? Complete Guide with Syntax and Examples (2026)

Image
What are Children Props in React? As you build React applications, you'll often create components that share the same layout but display different content. Instead of writing a new component for every small variation, React provides a simple and powerful solution called the  Children  prop. The  Children  prop is a special built-in prop that allows a component to receive and display whatever is placed between its opening and closing tags. This makes components more flexible because the structure stays the same while the content can change every time the component is used. For beginners, you can think of the  Children  prop as the inside content of a container. The container provides the design, while the content inside the container is supplied by the parent component. Understanding Children Props In React, data is usually passed to a component using props such as title,name or price. These values are passed as attributes. For example : <User name...

javaScript do while loop

javaScript do while loop



        

 JavaScript  Do While loop 


what is the Javascript  do .. While loop?

1] Do while loop in JavaScript is a control flow statement that continually runs a block of code until a given condition is evaluated to false. 

2] While a do...while loop is similar to a while loop, the main distinction is that the code block is run at least once before the condition is verified.


Syntax :-

do 

{

code executed

}

while (condition)


do :-

1] keyword starts the loop.

2] block of code executed first.

while :-

1] keyword condition that is evaluated after execute of the block of code.

2] condition evaluates true  block of code executed again than condition false the loop terminates.

FlowChar :-

 Do while loop


javascript  do while loop 

1] Example

Q.  Display  Number 10 to 1 

Source code

let a=10;
do{
    console.log(a);
    a--;

}while (a>0);

Explain program :-

1] a starts at 10 .

2] loop prints value of a and decrement (a--) after each iteration 

3] condition run long i  greater than 0

 Do while loop

Display  Number 10 to 1 

Output 

Display  Number 10 to 1  javascript

JavaScript do  while loop 

2] Example

Q. display number 11 to 20 using do.. while loop


let i = 11;
do {
  console.log(i);
  i++;
} while (i <= 20);


JavaScript  do while loop 

Output :-

javascript  while loop


JavaScript  do while loop 


3] Example

Q. user input using do while loop


let input ;
do {
    input =prompt("Enter a no between 1 to 100 ");
}
while (input <1 || input > 100 );
console.log("enter your number- " +input);

JavaScript Do while loop

Output:- 

javascript do- while loop

JavaScript do while loop 

4] Example

Q. javascript that iteration 28 times 


let count =0;
do {
    console.log("count number-", count);
    count++;

}
while(count<28);

JavaScript  do while loop 

 Output:-

javascript  do while loop


Related Post :-

php program to print alphabet pattern R

php program to print half diamond pattern

javascript operators

how to create a navigation bar

Comments

Popular posts from this blog

HTML Tag

CSS Text Color Explained with Syntax and HTML Examples

HTML Input Type Submit Syntax and Example