I have the following code
fs.createWriteStream( fileName, {
flags: 'a',
encoding: 'utf8',
mode: 0644
});
I get a lint error
Octal literals are not allowed in strict mode.
What is the correct way to do this code so I won't get a lint error?
Octal literals are not allowed in strict mode. What is the correct way to do this code so I won't get a lint error? Show activity on this post. Show activity on this post. In node and in modern browsers (see compatibility ), you can use octal literals:
SyntaxError in strict mode only. What went wrong? Octal literals and octal escape sequences are deprecated and will throw a SyntaxError in strict mode. With ECMAScript 2015 and later, the standardized syntax uses a leading zero followed by a lowercase or uppercase Latin letter "O" ( 0o or 0O) .
The JavaScript strict mode -only exception "0-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead" occurs when deprecated octal literals and octal escape sequences are used. SyntaxError in strict mode only. What went wrong?
Octal literals and octal escape sequences are deprecated and will throw a SyntaxError in strict mode. With ECMAScript 2015 and later, the standardized syntax uses a leading zero followed by a lowercase or uppercase Latin letter "O" ( 0o or 0O).
I came through this problem while using it in a scape squence:
console.log('\033c'); // Clear screen
All i had to do was convert it to Hex
console.log('\x1Bc'); // Clear screen
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With