Menu

gitpiper

isAsyncFunction javascript Code Snippet in 2023

typefunctionintermediate

Last Updated: 3 February 2023

Checks if the given argument is an async function.

  • Use Object.prototype.toString() and Function.prototype.call() and check if the result is '[object AsyncFunction]'.
const isAsyncFunction = val => Object.prototype.toString.call(val) === '[object AsyncFunction]';
isAsyncFunction(function() {}); // false isAsyncFunction(async function() {}); // true

javascript snippet similar to isAsyncFunction For You in February 2023

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️

© 2023 GitPiper. All rights reserved

Rackpiper Technology Inc

Company

About UsBlogContact

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️