Javascript how to change font properties to script?

I found this script which is perfect for what I need. However I would like to change the font properties to make it bold and red for the result displayed. I looked all over and tried adding it but …

How to display elements of this array?

var arr = [2, 6, 4, 4, 4, 9] var newArr = (arr.sort()) for (var i = 0; i < newArr.length; i++) if (newArr[i] == newArr[i + 1]) { var rem = [console.log(i)] //- (a) } console.log(rem[0]) ...