---
title: "Discussion on \"Why console.log() returns undefined?\" | Hashnode"
description: "Discussion on \"Why console.log() returns undefined?\". console.log() is a function. A function must always return some value to the caller. It's a ground rule.\nIf a return value is not specified, then the function will return undefined*.*\nFor example, see the below code.\nfunction addOneTo(a) {\n    const ..."
url: "https://hashnode.com/posts/why-consolelog-returns-undefined/63e88470c360862700409f47"
---

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

Discussion

# [Why console.log() returns undefined?](https://sudipta26.hashnode.dev/why-consolelog-returns-undefined?utm_source=hashnode&utm_medium=feed)

console.log() is a function. A function must always return some value to the caller. It's a ground rule. If a return value is not specified, then the function will return undefined\*.\* For example, see the below code. function addOneTo(a) { const ...

Feb 12, 2023 · 1 min read · sudipta26.hashnode.dev  
Read the article

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

## Written by

[Sudipta Chakraborty](https://hashnode.com/@sudipta26)

@sudipta26 · India

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

Aspiring Web Developer | neog'23 | 💻📚🎵

I start learning web development and documenting my learnings

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
