I'm currently learning javascript (by using Google Script currently), I feel like this is a simple mistake, but I can't figure out a way around it.
The code below works, if I set "var colour" to a colour code. But when I change it to an if statement I get the issue. I've tried a bunch of different formats and continued having the same issue...
For info it just gets a few rows from a spreadsheet and then formats the selected rows and displays it to the user.
//Example of part of working code:
if(Line.length == 0){
var Line = lines
.slice(1)
.filter(function(row) { return row[4] == e.message.text;})
.map(function(row) {
var colour = if(row[6]=1){return "#ff0000"};
return '<b>' + row[3] + '</b> ('+ row[1] + ' or ' +row[2] + ')' + '\n' + '<font color=' + colour + '>Region: ' + row[6] + "</font>";
});
}