Menu

gitpiper

functionName javascript Code Snippet in 2024

functionbeginner

Last Updated: 14 December 2024

Logs the name of a function.

  • Use console.debug() and the name property of the passed function to log the function's name to the debug channel of the console.
  • Return the given function fn.
const functionName = fn => (console.debug(fn.name), fn);
let m = functionName(Math.max)(5, 6); // max (logged in debug channel of console) // m = 6

javascript snippet similar to functionName For You in December 2024

Subscribe to our Newsletter

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

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