---
title: "Discussion on \"The weird quirk of logging with console.log in JavaScript\" | Hashnode"
description: "Discussion on \"The weird quirk of logging with console.log in JavaScript\". The goal of this post\nI want to clarify what happens with console.log on certain conditions so that I can log in my intended way.\nTLDR\nWhen logging objects with console.log, clone them first before logging.\nvar obj = { value: \"hello\" };\n\nvar objClone..."
url: "https://hashnode.com/posts/the-weird-quirk-of-logging-with-consolelog-in-javascript/610543ab3b9b85399dcf3129"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [The weird quirk of logging with console.log in JavaScript](https://genakag.hashnode.dev/the-weird-quirk-of-logging-with-consolelog-in-javascript?utm_source=hashnode&utm_medium=feed)

The goal of this post I want to clarify what happens with console.log on certain conditions so that I can log in my intended way. TLDR When logging objects with console.log, clone them first before logging. var obj = { value: "hello" }; var objClone...

Jul 31, 2021 · 2 min read · genakag.hashnode.dev  
Updated Aug 4, 2021  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)

## Written by

[Gene Nakagaki](https://hashnode.com/@genakag)

@genakag · Tokyo, Japan

  
[View profile](https://hashnode.com/@genakag)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
