---
title: "Discussion on \"JavaScript Quirks: Dot vs. Bracket - Not all notation is created equally\" | Hashnode"
description: "Discussion on \"JavaScript Quirks: Dot vs. Bracket - Not all notation is created equally\". You probably have noticed there are two ways to access a property on an object:\n\nDot notation\nBracket notation\n\nNaturally, you might assume they behave in the same way, but that's not quite the case. We will examine some differences below.\nDot notati..."
url: "https://hashnode.com/posts/javascript-quirks-dot-vs-bracket-not-all-notation-is-created-equally/5f6334260f115919981fce8b"
---

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

Discussion

# [JavaScript Quirks: Dot vs. Bracket - Not all notation is created equally](https://jameswilliams.hashnode.dev/javascript-quirks-dot-vs-bracket-not-all-notation-is-created-equally?utm_source=hashnode&utm_medium=feed)

You probably have noticed there are two ways to access a property on an object: Dot notation Bracket notation Naturally, you might assume they behave in the same way, but that's not quite the case. We will examine some differences below. Dot notati...

Sep 17, 2020 · 3 min read · jameswilliams.hashnode.dev  
Read the article

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

## Written by

[James Williams](https://hashnode.com/@jameswill1ams)

@jameswill1ams

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

## Responses 3

Markdown supported · ⌘↵ to post

[Blaine Garrett](https://hashnode.com/@blainegarrrett)

[Sep 17, 2020](https://hashnode.com/posts/javascript-quirks-dot-vs-bracket-not-all-notation-is-created-equally/5f6334260f115919981fce8b/comment/5f63f13042517c2434461d55)

Good article.

It might be worth mentioning [Symbols](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) are also allowed. I've only run into them as object keys in some Google cloud libs. The only reason I like them (conceptually) is that they're harder to manually re-create when constants should be used since each instance is unique. I believe this is their explicit reason for existing.

[James Williams](https://hashnode.com/@jameswill1ams)

[Sep 18, 2020](https://hashnode.com/posts/javascript-quirks-dot-vs-bracket-not-all-notation-is-created-equally/5f6334260f115919981fce8b/comment/5f63f13042517c2434461d55#reply-5f64953a96b4a436fe135ed9)

Great point [Blaine Garrett](https://hashnode.com/@blainegarrrett). I will make a note of it, and include it in a future update to the article. Thanks

[Dinys Monvoisin](https://hashnode.com/@dinmon)

[Sep 17, 2020](https://hashnode.com/posts/javascript-quirks-dot-vs-bracket-not-all-notation-is-created-equally/5f6334260f115919981fce8b/comment/5f633a5b1d914f19b97de9b8)

What you mean by the below phrase?

> you might assume they behave in the same way, but that's not quite the case

They are a totally different thing, and each is used in different ways.

I guess I did not get the last section **Dot notation - identifiers before variables** what you wanted to say. That's why I can't puzzle what you mean.

[James Williams](https://hashnode.com/@jameswill1ams)

[Sep 17, 2020](https://hashnode.com/posts/javascript-quirks-dot-vs-bracket-not-all-notation-is-created-equally/5f6334260f115919981fce8b/comment/5f633a5b1d914f19b97de9b8#reply-5f63408d1d914f19b97dea03)

Hi [Dinys Monvoisin](https://hashnode.com/@dinmon), I think we agree. My point was if somebody is learning JavaScript for the first time, they might believe that dot and bracket notation are the same, but they are not.

The last point is connected to it, if you were trying to use bracket and dot notation at the same, you might have some unexpected results if you are not aware of the differences.

Maybe my last heading is bad, and I have to edit it :)

[Dinys Monvoisin](https://hashnode.com/@dinmon)

[Sep 17, 2020](https://hashnode.com/posts/javascript-quirks-dot-vs-bracket-not-all-notation-is-created-equally/5f6334260f115919981fce8b/comment/5f633a5b1d914f19b97de9b8#reply-5f6345191d914f19b97dea35)

Oh, ok I did not know it was for beginners. Yet, it is still hard to understand what you are trying to mean? Imagine how it should be for someone starting.

[Tapas Adhikary](https://hashnode.com/@atapas)

[Sep 17, 2020](https://hashnode.com/posts/javascript-quirks-dot-vs-bracket-not-all-notation-is-created-equally/5f6334260f115919981fce8b/comment/5f6337c51d914f19b97de980)

[James Williams](https://hashnode.com/@jameswill1ams), Good one James! Very crisp and neat way of explaining..

Over the period.. I've got used to the brackets.. Felt it like fail-safe :)

[James Williams](https://hashnode.com/@jameswill1ams)

[Sep 17, 2020](https://hashnode.com/posts/javascript-quirks-dot-vs-bracket-not-all-notation-is-created-equally/5f6334260f115919981fce8b/comment/5f6337c51d914f19b97de980#reply-5f6340e30f115919981fcf67)

Thanks, glad you enjoyed it. Brackets for the win :)
