Comment

Comment by ramesh31

  if (
    typeof stripe === "object" &&
    typeof stripe.handleCardPayment === "function"
  ) {
    stripe.handleCardPayment(/\* ... \*/);
  } else {
    logger.capture(
      "[Payment] Card charge — Unable to fulfill card payment 
      because stripe.handleCardPayment was unavailable"
    );
  }"
This is silly. With modern JS tooling you should never be worried if a function exists; that should be caught at compile time.
parent ramesh31 5 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton