Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send control char using strict mode in javascript?

Tags:

javascript

"use strict";
var debug = function( m ) { 
    console.log('   \033[32mdebug -\033[39m:' + m ); 
}

The \033 is not going to fly with the strict mode any way around that beside taking off the strict mode?

like image 906
AvengerMoJo Avatar asked Apr 16 '12 07:04

AvengerMoJo


1 Answers

Use \u001b instead. \0... is an octal escape sequence which your JavaScript environment might not support.

like image 159
Aaron Digulla Avatar answered Sep 22 '22 13:09

Aaron Digulla