Skip to content

Commit

Permalink
Dynamic args for console.log
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonArmand committed Dec 31, 2019
1 parent 77941da commit 5940ac2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/views/Playground/Playground.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ export default function Playground(props) {
const displayCode = beautify(currentCode)
const log = []

console.log = function(message){
log.push(message)
console.log = function(...args){
args.forEach(e=>{
log.push(e)
})
}

let unsavedCode = displayCode
Expand Down

0 comments on commit 5940ac2

Please sign in to comment.