Answers for "timeout or time-out"

28

timeout javascript

setTimeout(function(){
 	//code goes here
}, 2000); //Time before execution
Posted by: Guest on April-13-2020
1

Timeout

setTimeout(myFunction, 3000);
Posted by: Guest on March-04-2022
0

set time out

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

export default function App() {
  const [count, setCount] = useState(0);

  useEffect(() => {
   const timeout = setTimeout(() => {
      setCount(1);
    }, 3000);
  },[]);

  return (
    <div className="App">
      <h1>{count}</h1>
      <button onClick={() => setCount(count + 1)}>Increment</button>
    </div>
  );
}
Posted by: Guest on May-10-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language