convert arrow function to normal function javascript online code example

Example 1: how to make javascript function consise

multiplyfunc = (a, b) => { return a * b; }

Example 2: convert arrow function to normal function javascript online

getEventById: state => id => {
      return state.todos.find(x => x.id === id)
    }

Example 3: convert arrow function to normal function javascript online

export const loadUser = () => (dispatch, getState) => {
  if (!getState().auth.token) {
    dispatch({ type: LOGIN_FAIL });
    return;
  }

  // User Loading
  dispatch({ type: USER_LOADING });

  axios
    .get('/api/auth/user', tokenConfig(getState))
    .then(res => {
      dispatch({
        type: USER_LOADED,
        payload: res.data,
      });
    })
    .catch(err => {
      console.warn(`Error returned: ${err}.`);

      dispatch({
        type: AUTH_ERROR,
      });
    });
};

Example 4: convert arrow function to normal function javascript online

const Home: React.FC<Person> = (person) => {
    useEffect(() => {
    }, []);
    return (
        <>
            <div>
                <h3>{person.name}</h3>
                <h3>{person.idCard}</h3>
            </div>
        </>
    );
};

Example 5: convert arrow function to normal function javascript online

const Home: React.FC<Person> = (person) => {
    useEffect(() => {
    }, []);
    return (
        <>
            <div>
                <h3>{person.name}</h3>
                <h3>{person.idCard}</h3>
            </div>
        </>
    );
};

Example 6: convert arrow function to normal function javascript online

return fns.reduce((a, b) => (...args) => a(b(...args)));