Debugging my code

I'm getting errors in my view. How do I go about debugging my code?

The easiest way to debug is to build logging into your code. This can be done by simply inserting a console.log() statement into the problematic code.

e.g.:

function foo(param) {

// check the parameter is being passed
console.log('parameter' + param);

// check the value of the parameter attribute
console.log('status' + param.status);

    if (param.status === true) {
        //do logic
    }
}

These logs can be accessed in debug mode in the JourneyApps Chrome container by right clicking in the application and choosing "toggle dev tools". These logs are also available via diagnostics reports from end users.

1 Like

I am noticing that my application is running slower when I have the console open than when its closed. Is this cause for concern?