From 683ed12730742215df4985dbf6bf34f81bbd77cf Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 22 Feb 2020 10:59:22 +0100 Subject: [PATCH] Add a function to help with logging. --- carousel.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/carousel.js b/carousel.js index 1a38e1b..cf4e575 100644 --- a/carousel.js +++ b/carousel.js @@ -1,5 +1,16 @@ 'use strict'; +// Log with deep clone, so that the browser will show the object at time of log, +// instead of what it looks like at time of view. +function dlog() +{ + let args = []; + for (const arg of arguments) { + args.push(JSON.parse(JSON.stringify(arg))); + } + console.log(args); +} + function addheading(carousel, colspan, content) { let thead = document.createElement("thead"); -- 2.39.2