Custom IML functions

Debug custom IML functions with a variety of tools

To debug your IML functions, output the code and use a tool of your choosing.

Output a message to the web console

You can use debug inside your IML functions to print a message or mid-results of your code. During the function execution, debug messages are visible inside the console of your browser.

To open the developer console in Google Chrome, open the Chrome Menu in the upper-right-hand corner of the browser window and select More Tools > Developer Tools. You can also use Option + ⌘ + J (on macOS), or Shift + CTRL + J (on Windows/Linux).

function add(a, b) {
    	let sum = a + b;
    
        //instead of usual console.log(), use debug().
        debug("a = " + a) 
	debug('b = ' + b)
	debug(`a+b = ${sum}`)
	
	return sum;
}

By using debug() you can understand what data you are manipulating inside a function.

Debug the JavaScript snippet

To debug the output, you can use a variety of tools. Search online to find a JavaScript debugging tool that you prefer.

Here are some to choose from:

function myFunction(x) {
    x = x + 1;
    //do something
    console.log(x); // outputs the value of x at this point
    return x;
}

myFunction(1);

You can use this code to test the functionality of the JavaScript debugger to see how it works.

Last updated