Question: I would like to jump to the start of a Bash script. Is there an easy way to do this?

```
#start
echo "Start"

read -p "Input: " i

if [ i = j ]
then
z=1

elif [ i = n ]
then
#jump to start

elif [ i = x ]
then
exit
fi

```

Answer: 
You can set results as state and update it on `onClick` and use `else ... if` for check

```
const [results, setResult] = useState("");

const onClick = () => {
    // check users guess against randonNumber
    const userGuess = value;
    if (userGuess == randomNumber)
      setResult(<p className="alert alert-success">Correct!</p>);
    else if (userGuess > randomNumber)
      setResult(<p className="alert alert-warning">Too high, guess again</p>);
    else if (userGuess < randomNumber && userGuess !== "")
      setResult(<p className="alert alert-warning">Too low, guess again</p>);
    else setResult("");
  };

  return (
    <>
      <h2>Guess The Number game</h2>
      <p className="lead">Guess a number between 1 and 10.</p>
      <input value={value} type="number" onChange={onChange} />
      <button type="submit" onClick={onClick}>
        GUESS
      </button>
      <br />
      <br />
      {results}
    </>
  );

```

check here [CodeSandBox](https://codesandbox.io/s/guess-the-number-game-1pqmq)
results = onClick(value) this statement class the onClick function every time you change the value of input. so i have updated the code.

```
import React, { useState } from "react";

let randomNumber = Math.round(Math.random() * 10);

const GuessTheNumber = () => {
  const [value, setValue] = useState("");
  const [statement, setStatement] = useState("");

  const onClickHandler = () => {
    // check users guess against randonNumber
    const userGuess = value;
    if (userGuess === "") return null;
    if (userGuess === randomNumber) setStatement("<p className="alert alert-success">Correct!</p>");
    if (userGuess > randomNumber) setStatement("<p>Too high, guess again</p>");
    if (userGuess < randomNumber) setStatement("<p>Too Low, guess again</p>");
  };

  return (
    <>
      <h2>Guess The Number game</h2>
      <p className="lead">Guess a number between 1 and 10.</p>
      <input
        value={value}
        type="number"
        onChange={e => setValue(e.target.value)}
      />
      <button type="submit" onClick={onClickHandler}>
        GUESS
      </button>
      <br />
      <br />
      {statement}
    </>
  );
};

export default GuessTheNumber;

```