Append Log Lines
NodeJS
Easy
3 views
Problem Description
Append a new line to meetcode.log with current time.
Output Format
Print file path.
Constraints
Use appendFileSync for simplicity.
Official Solution
const fs = require('fs');
const line = new Date().toISOString() + ' meetcode\
';
fs.appendFileSync('meetcode.log', line, 'utf8');
console.log('meetcode.log');
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!