---
title: "Discussion on \"Using Array.keys() blew my mind.\" | Hashnode"
description: "Discussion on \"Using Array.keys() blew my mind.\". Context to why I used Array.keys?\nIn the eCommerce website, I was building, my goal was to create a select form that held options for the quantity a customer wanted to purchase. The quantity was based on the stock amount of a specific product in whic..."
url: "https://hashnode.com/posts/using-arraykeys-blew-my-mind/5f943f4640346172a86c1a97"
---

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

Discussion

# [Using Array.keys() blew my mind.](https://lorenzejay.hashnode.dev/using-arraykeys-blew-my-mind?utm_source=hashnode&utm_medium=feed)

Context to why I used Array.keys? In the eCommerce website, I was building, my goal was to create a select form that held options for the quantity a customer wanted to purchase. The quantity was based on the stock amount of a specific product in whic...

Oct 24, 2020 · 3 min read · lorenzejay.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#array-methods](https://hashnode.com/tag/array-methods)
-   [#frontend-development](https://hashnode.com/tag/frontend-development)

## Written by

[Lorenze Jay Hernandez](https://hashnode.com/@Lorenzejay)

@Lorenzejay · California, US

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

Software Development | JavaScript | Applescript | Productivity Enthusiast

A web developer from Los Angeles. I build accessible, inclusive products and digital experiences for a variety of clients. Also interested in how code can be used for workspace automation &amp; productivity optimization.

## Responses 3

Markdown supported · ⌘↵ to post

[Mudit Tiwari](https://hashnode.com/@shoutox)

[Oct 25, 2020](https://hashnode.com/posts/using-arraykeys-blew-my-mind/5f943f4640346172a86c1a97/comment/5f95032c40346172a86c2073)

Most bizarre thing about this post is that I literally just learned about this same thing, for a very different reason(I was searching for a substitute for the range method used in Python that returns a list of numbers, from the number passed as the first parameter, till one before the number passed in the second parameter, e.g., range(1, 5) returns \[1, 2, 3, 4\] if I'm not wrong, I haven't wrote Python for a so long). It's always good to brush up about what I've learned though, really exciting coincidence lol. Good Job describing how it works, btw :)

[Anjanesh Lekshminarayanan](https://hashnode.com/@anjanesh)

[Oct 25, 2020](https://hashnode.com/posts/using-arraykeys-blew-my-mind/5f943f4640346172a86c1a97/comment/5f94e3dffbdce372c9a57589)

Similarly you can make use of `Object.keys()` for an object just like in PHP's associated array.

[Sandeep Panda](https://hashnode.com/@sandeep)

[Oct 24, 2020](https://hashnode.com/posts/using-arraykeys-blew-my-mind/5f943f4640346172a86c1a97/comment/5f94820efbdce372c9a5732c)

Very interesting!! Learned something cool.

[Lorenze Jay Hernandez](https://hashnode.com/@Lorenzejay)

[Oct 24, 2020](https://hashnode.com/posts/using-arraykeys-blew-my-mind/5f943f4640346172a86c1a97/comment/5f94820efbdce372c9a5732c#reply-5f94897540346172a86c1de0)

Thank you. I’m glad you did.
