Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts

Tracing Function Calls in JavaScript or Node.js or Dialogflow

For debugging our code we often need to track the function call hierarchy. There we need to understand and visualise which function is being called by which function and their sequence of calls. If you search for this in JavaScript then you will either find the deprecated features like Function.caller or not very flexible or useful features like console.trace(). So I found no better way than my custom developed one (as follows) to trace function calls in JavaScript while building my Google Dialogflow Chatbot.

GAS Function to get the Count of a Specified Item in an 1D Array

A JavaScript function, specially meant for Google Apps Script or GAS, to get the count of a specified item (case sensitive) in an one dimensional (1D) array. It takes the parameters such as "array" which is the one dimensional array on which the search needs to be done. And the other parameters and return value are explained in the function below itself in JSDoc format.

GAS Function to search a value in a Multidimensional Array

A JavaScript function, specially meant for Google Apps Script or GAS, to get the vertical (column-wise) lookup value from a multi-dimensional array. It takes the parameters such as "searchValue" which is the value to search for the lookup. And the other parameters and return value are explained in the function below itself in JSDoc format.