Menu

gitpiper

isAsyncFunction javascript Code Snippet in 2022

typefunctionintermediate

Last Updated: 25 September 2022

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 September 2022

Subscribe to our Newsletter

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

© 2022 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! ✌️