Freecodecamp Random quote machine

import React, { useState } from ‘react’;
import ‘…/Html.css’;

export default function Random() {
const [srr,setSrr]=useState(“In order to succeed, your desire for success should be greater than your”)
const start=()=>{

    let arr=["Strive not to be a success, but rather to be of value","Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless.","The most difficult thing is the decision to act, the rest is merely tenacity.","If the wind will not serve, take to the oars.","Remember that not getting what you want is sometimes a wonderful stroke of luck.","Either write something worth reading or do something worth writing.","First, have a definite, clear practical ideal; a goal, an objective. Second"," have the necessary means to achieve your ends; wisdom, money, materials, and methods. Third", "adjust all your means to that end."]
    const ran=Math.floor(Math.random() * 9)
   setSrr(arr[ran])


}

return (


{srr}

New Quote
</div>

)
}

add this exercise/step url as well, thanks and happy coding :slight_smile:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.