Automatically translated.View original post

array JavaScript

# Web Site Writing Basics

# javascrip

# array

An Array in JavaScript is a sequenced list data structure used to store multiple values in a single variable.

Key attributes of arrays in JavaScript

Storage of multiple values: An array allows you to store different values (such as numbers, strings, objects, functions, or even other arrays) under a single variable name.

Index Access: Each member of the array is assigned a numerical index. Starting at 0 for the first member, 1 for the second, and so on. You can access or edit each member using this index.

Dynamic Size: Arrays in JavaScript can grow or shrink during program execution (no fixed size needed to be defined in the first place).

Mixed data types: Members within the same array, not necessarily the same data type (e.g. you can have numbers, strings, and booleans in the same array)

Array Creation

You can create arrays in many ways, but the most common is to use square brackets ([]):

JavaScript

/ / Create an empty array.

Let emptyArray = [];

/ / Create an array with members.

Let fruits = ["Apple," "Banana," "Cherry"];

/ / Create an array with mixed data types.

let mixedArray = [10, "Hello," true, {key: "value"}];

Access and editing members

Use the index within square brackets ([]) to access members:

JavaScript

Let colors = ["Red," "Green," "Blue"];

/ / Access to members

console.log (colors [0]); / / Result: "Red" (first member)

console.log (colors [2]); / / Result: "Blue"

/ / Membership amendments

Colors[1] = "Yellow";

console.log (colors); / / Results: ["Red," "Yellow," "Blue"]

/ / Monitoring the length of the array

console.log (colors.length); / / Results: 3

Arrays are a very basic and important tool in JavaScript programming for data set management.

2025/10/5 Edited to

... Read moreถ้าเจอคำว่า “array” แล้วอยากรู้ว่า array แปลว่าอะไรแบบสั้นๆ: โดยทั่วไปแปลได้ว่า “อาร์เรย์” หรือ “ชุดข้อมูล/รายการข้อมูล” คือการเอาค่าหลายๆ ค่า (เช่น ตัวเลขหรือข้อความ) มาวางเรียงกันเป็นลำดับ เพื่อให้จัดการได้ง่ายขึ้นในตัวแปรเดียว ใน JavaScript เวลาเราใช้ Array จะรู้สึกเหมือนมี “ลิสต์” เก็บของหลายชิ้นไว้ด้วยกัน เช่น เก็บตัวเลข 1–5 หรือเก็บชื่อผลไม้หลายชื่อ พอเป็นชุดข้อมูลแล้ว เราจะหยิบทีละชิ้นออกมาได้ด้วย “index” (ดัชนี) ที่เริ่มจาก 0 เสมอ ตัวอย่างที่เห็นบ่อยมากคือ - numbers = [1,2,3,4,5] (Array เก็บตัวเลข) - fruits = ["มะม่วง","มังคุด","ทุเรียน"] (Array เก็บข้อความ/สตริง) - mixedArray = [100, true, "javascript", {}] (เก็บข้อมูลหลายประเภทใน Array เดียว) สิ่งที่มือใหม่มักพลาดเวลาอ่านว่า “array แปลว่า” คือเข้าใจว่าเป็นแค่คำศัพท์ แต่จริงๆ มันเป็นแนวคิดสำคัญในการเขียนโปรแกรม: เราใช้ Array เพื่อจัดการข้อมูลหลายค่า เช่น รายการสินค้า คะแนนสอบ รายการงานที่ต้องทำ หรือข้อมูลที่ได้จาก API ทริคจำง่ายๆ ที่ผมใช้คือ “Array = กล่องยาวๆ ที่มีช่องเรียงกัน” - แต่ละช่องคือ element (สมาชิก) - เลขหน้าช่องคือ index (เริ่ม 0) ตัวอย่างการใช้งานที่ช่วยให้เห็นภาพ: 1) อยากหยิบ “สมาชิกตัวแรก” ออกมา fruits[0] จะได้ "มะม่วง" 2) อยากเปลี่ยนค่าช่องที่ 2 (index 1) fruits[1] = "เงาะ" ก็จะแทนที่ "มังคุด" 3) อยากรู้ว่ามีกี่ตัว fruits.length จะบอกจำนวนสมาชิกทั้งหมด สรุปอีกที: ถ้ามีคนถามว่า “array แปลว่าอะไร” ในบริบท JavaScript ให้ตอบได้เลยว่า “ชุด/รายการข้อมูลที่เรียงลำดับ เก็บหลายค่าในตัวแปรเดียว และเข้าถึงด้วย index” แค่นี้ก็ตรงเจตนาค้นหา และเอาไปต่อยอดเขียนโค้ดได้ทันที

Related posts

A laptop screen displays lines of code, with text overlayed saying 'free websites to learn coding' and 'new skill,' encouraging users to swipe for more information on learning to code during a study break.
A laptop screen shows code, overlaid with a pop-up featuring 'codecademy.com.' The pop-up highlights interactive coding courses and a sign-up form, promoting it as a free resource for learning various programming languages.
A laptop screen displays code, overlaid with a pop-up featuring 'freecodecamp.com.' The pop-up describes it as a nonprofit offering free comprehensive web development and data analytics curriculum, including certifications.
On a study break? Try to learn how to code! 👩🏻‍💻
Learning coding during a study break is a productive way to use your time. It provides a mental shift from regular studies, enhances problem-solving skills, and fosters creativity. Online coding platforms offer flexibility, allowing you to learn at your own pace. This makes coding an ideal acti
teal.days

teal.days

2485 likes

5 Free Online Certification Sites to Boost Resume
5 Free Online Certification Sites to Boost Resume Hi, lemons! Today's digital landscape offers a wealth of professional development opportunities right at our fingertips. Enhancing your skills and expanding your knowledge has never been more accessible or more critical. Here are five sites o
Lifestyle Babe

Lifestyle Babe

6954 likes

A desk setup with a computer screen displaying the Khan Academy website, showing course categories like 'Careers' and 'Computer programming'. A pink lululemon water bottle is on the right. Text overlay reads 'how to learn for free' and 'SWIPE TO VIEW'.
A webpage for grow.google.com, asking 'What would you like to learn?' with options for career and business growth. It highlights free courses and certifications, providing tools and resources for skill development and career advancement.
A webpage for Khan Academy, titled 'My courses', showing various learning paths including 'Careers', 'Computer programming - JavaScript and the web', and 'Intro to computer science - Python'. It describes Khan Academy as a free resource for diverse subjects.
learn for free with these websites 🎀
‧°𐐪♡𐑂°‧₊ ⛄️ Learning new knowledge or skills can be completely free using these websites! It’s a great way to spend your free time ✨ Open University & Khan Academy is perfect for students wanting to enhance knowledge of content they already know to study, go ahead of content or learn knowl
peachiesuga ♡

peachiesuga ♡

6690 likes

Tech jobs you can do without prior experience 🖥️
🖥️ 👩‍💻Web Developer : Build and maintain websites, ensuring they are functional, user-friendly, and visually appealing. Work with front-end and back-end technologies like HTML, CSS, JavaScript, and databases. 💰 Starting Salary: $55,000 - $65,000 per year 📊📈 Data Analyst: Analyze and interpret
vedha | career tips (tech) 👩‍

vedha | career tips (tech) 👩‍

3628 likes

How to Learn Coding Fast Even as a Beginner
#codingforbeginners #programming #studymotivations #webdevelopment #learntocode
Aysha

Aysha

802 likes

A laptop displays the "Marketing Examples" website, showcasing various marketing case studies like influencer ads, upsells, and viral content strategies. The image is overlaid with the title "Learning Websites to Level Up Your Skills."
The Codecademy website is shown, featuring career paths like Front-End Engineer and Data Scientist, alongside popular courses such as Learn Python 3, HTML, and JavaScript. It highlights a user-friendly approach to coding lessons.
The DataCamp website is displayed, promoting learning data skills from non-coding essentials to data science and machine learning. It illustrates a learning methodology of assessing, learning, applying, and practicing to develop data skills.
Learning Websites to Level Up Your Skills
They make the learning journey feel less like a lecture and more like a chat with a knowledgeable friend. Codecademy – my coding guru! 🤓✨ Forget the boring textbooks; this platform brings the coding game to life with a user-friendly vibe and hands-on lessons. Learning Python, Java, or HTML? They
Reverelia

Reverelia

1437 likes

A tablet on a desk displays code, with a colorful keyboard and notebook beside it. The image is overlaid with text "STUDY HACKS For ADHD Students" and "SWIPE".
A tablet shows the Pomofocus.io website with a large 25:00 timer and task list. Overlay text describes Pomofocus.io for the Pomodoro technique.
A tablet displays the Chrome Web Store page for the Speechify Text to Speech Voice Reader extension. Overlay text explains Speechify as a text-to-speech tool.
Study sites you need if you have ADHD
As someone with ADHD, I wish someone would’ve told me of the resources and techniques to help me study, so I put together 3 resources and their studying techniques to help you all. Here they are 1. POMODORO TECHNIQUE: this is a time management technique based on 25-minute stretches of focused w
Byaombe •••

Byaombe •••

1573 likes

Want to earn more? Master these 4 skills in 2025
1. Copywriting Imagine getting paid to write captions, ads, or emails that MAKE MONEY for brands, ghat’s copywriting for you. Start by searching “How to write persuasive copy” on YouTube. Many creators share real-world tips for beginners. Example? Alex Cattoni or Gary Vee talk about creating catch
emilie.studygram

emilie.studygram

1562 likes

A laptop displays coding terminal output with a keyboard in the foreground, featuring the text "BEST AI Tutor for Coding," highlighting an AI-powered programming learning platform.
BEST AI Tutor for Coding
Best AI Tutor for Coding in 2026? This Is What Serious Learners Are Switching To Most people don’t fail at coding because it’s hard. They fail because they’re learning alone. Watching tutorials. Copying code. Getting stuck. Quitting. BootSelf changes that. BootSelf is an AI-powered coding tuto
Code with BootSelf AI

Code with BootSelf AI

17 likes

A dark image showing code on a screen and a keyboard, with text overlays "Top 10 Free Online Courses with Certificates" and "SWIPE FOR MORE," indicating a list of educational resources.
A collage of four logos for online learning platforms: Google Digital Garage, Harvard University, Coursera, and LinkedIn Learning, highlighting various educational opportunities.
A collage of four logos for online learning platforms: Alison, The Open University, a green hexagonal logo with a figure and leaves, and a purple upward-pointing arrow logo.
Top 10 Free Online Courses W/ Certificates
With me having no friends😅 I try and find resourcesful tool and reasouces I can use to better myself in difficult skill aspects! I’ve actually tried a couple of these and currently using Udemy rn! It’s never ending courses. Here’s details on each website! Would you try and of these? Also this is my
Iamnariah

Iamnariah

13.3K likes

A woman lies on a bed of money, smiling and holding dollar bills, with a world map graphic in the background. The text overlay reads "11 SECRET WAYS TO EARN MONEY WITH AI CHATGPT AND MIDJOURNEY."
This image presents the first secret way to earn money: "1. Write and publish blog posts." It outlines steps to establish a blog, set up ChatGPT, and generate content using AI prompts.
This image details the third secret way: "3. Build an App, Website, or Service." It explains how ChatGPT can assist in coding, debugging, and providing instructions for creating technology products.
11 secret ways to earn money with chat gpt
11 secret ways to earn money with chat gpt
Valder

Valder

157 likes

Kickstart your coding career with these 3 tools!
Are you wanting to learn to code, but do not want to pay the huge costs of bootcamps or courses? Here are free coding learning platforms/courses to look at: ✺ | Free Code Camp Free Code Camp has over 10,000 tutorials! Their tutorials cover front-end, back-end, data visualization, and so much mo
Itsleilahclaire

Itsleilahclaire

124 likes

BOOST Your Career: 4 FREE Online Courses for You
Are you wanting to up your resume and LinkedIn profile? There are so many ways to go about it, but free courses can really help! Here are a few sites with free courses to take. Harvard + EdX Price: Free Course Topics: Computer Science, Programming with Python, Artificial Intelligence with Pyth
Itsleilahclaire

Itsleilahclaire

1732 likes

Important CS courses every student should take 3
This is the last part of the 3 part series on Important CS courses every student should take! 1. Human-Computer Interaction (HCI): - Focuses on designing user-friendly interfaces and understanding how humans interact with computers. 2. Cybersecurity: - Teaches techniques to secure com
anjali.gama

anjali.gama

23 likes

A scenic view of a coastal town with white buildings and blue sea, featuring text overlay "3 websites for free tech certifications BEGINNER FRIENDLY".
A person in a straw hat looking at a white-washed coastal town, with text overlay "1. Google Skillshop Google Analytics Individual Qualification Google Ads Certifications".
A person looking at a white-washed coastal town with pink flowers, featuring text overlay "2. Microsoft Learn Microsoft Azure Fundamentals Power BI Data Analyst Associate".
3 websites for free tech certifications - beginner
1. Google Skillshop - What It Offers: Free certifications in Google products like Google Analytics, Google Ads, and Google Cloud. - Best For: Digital marketing, data analysis, and cloud computing beginners. - Key Certifications: - Google Analytics Individual Qualification
vedha | career tips (tech) 👩‍

vedha | career tips (tech) 👩‍

916 likes

A computer screen displays Haskell code in an IDE, with the title 'LEARNING HOW TO CODE'. The screen shows code lines, file explorer, and status bar, set against a background with butterfly patterns, illustrating the start of a coding journey.
This image titled 'CHOOSING A LANGUAGE' presents popular programming languages: Python, Java, and JavaScript, each with its logo and a brief description highlighting their characteristics and suitability for beginners or experienced programmers.
Titled 'HOW TO START', this image outlines steps for learning to code, including finding resources, joining communities, completing coding challenges on platforms like HackerRank, and focusing on proficiency in one language.
Becoming a tech girly 👩🏾‍💻: Learning How to Code
Hi! I'm new to Lemon8 ✨ and this is my first post ☺️ I'm currently working as a software engineer and thought I'd share some of my ideas about how you can get started with programming. I've invested a lot of time getting underrepresented groups into the field of tech through
Lauren Williams

Lauren Williams

474 likes

A desk setup with a monitor, white keyboard, and pink mouse, featuring the title 'best websites for learning computer science' and a 'Start' button.
A tablet displaying the GitHub website, with text overlay 'github Collaborate, host, and manage your coding projects seamlessly.'
A tablet displaying the Stack Overflow website, with text overlay 'stack overflow Get answers to coding questions and learn from industry professionals.'
Sites for CS Students!
Learning computer science can feel like drinking from a firehose sometimes, but the right resources make all the difference. Whether you’re debugging code, prepping for interviews, or diving into data science, these websites are absolute must-haves. GitHub is your go-to for managing projects and
CompSkyy

CompSkyy

217 likes

A laptop, a Starbucks drink, and a muffin on a wooden table, with the overlaid text "5 WEBSITES TO LEARN PROGRAMMING FOR BEGINNERS".
A MacBook Air displaying the FreeCodeCamp website, which offers free coding lessons and certifications. The text "FREECODECAMP" with an arrow points to the screen.
A MacBook Air showing the Codecademy website, featuring its basic, plus, and pro pricing plans. The text "CODECADEMY" with an arrow points to the screen.
Learn programming for free 👩‍💻
1. FreeCodeCamp - Languages: JavaScript, Python, SQL, HTML/CSS, and more. - Hands-on Projects: FreeCodeCamp is project-driven, meaning as you go through the curriculum, you'll build real-world applications like weather apps, portfolio websites, and data visualization projects. The full-
vedha | career tips (tech) 👩‍

vedha | career tips (tech) 👩‍

612 likes

A tech career tip slide titled "FRONTEND DEVELOPER" with "What to study + free resources" and "SWIPE STEP BY STEP GUIDE." It shows a laptop on a desk with a lamp and plant, indicating a guide for aspiring developers.
A slide titled "1. Learn HTML, CSS, and JavaScript" with descriptions for each and study resources like freeCodeCamp and MDN Web Docs, set against a scenic coastal town backdrop.
A slide titled "2. Master Responsive Design and CSS Framework" explaining mobile-friendly designs and frameworks like Bootstrap or Tailwind CSS, with W3Schools and Bootstrap documentation as resources, against a sunny street scene.
How to become a Frontend developer 👩‍💻💰
1. Learn HTML, CSS, and JavaScript - What to study: Begin with HTML for structuring web pages, CSS for styling, and JavaScript for adding interactivity. - Free resources: Websites like freeCodeCamp and MDN Web Docs provide comprehensive lessons on these topics. - Why it’s important: The
vedha | career tips (tech) 👩‍

vedha | career tips (tech) 👩‍

24 likes

Quen and Larray didn’t become the white chicks, the white chicks became them 😭💅🏼 @quenblackwell @Quensadilla @larray #quenblackwell #quenlinblackwell #halloweencostume #larray #whitechicks
Nat Nat

Nat Nat

1407 likes

5 Learn to Code Sites You Haven’t Heard Of
If you’re learning computer programming and want to know where to find FREE intermediate resources…here are some that I like! Let me know if you’ve used any. 1. FullStackOpen Free courses focused on building web apps. They teach React Native, GraphQL, Typescript, Containers and Database
Study Seal

Study Seal

241 likes

A woman works on a laptop by a large window overlooking a city skyline, with the title "Top Free Platforms To Learn Coding" overlaid.
The Codecademy logo is displayed above a text box detailing its interactive coding lessons, quizzes, and projects for beginners, set against an orange cityscape.
The Coursera logo is shown above a text box explaining its free coding courses from universities, including assignments and peer-reviewed projects, against an orange cityscape.
Top Free Platforms to Learn Coding
If you aren’t sure if coding it for you, there are multiple free platforms you can check out to give it a shot! I started learning how to code through the following platforms around 5 years ago, loved it and decided to major in Computer Science at University of Maryland, and am now a software engin
anjali.gama

anjali.gama

309 likes

Did you know??
That your phone logs your websites you visit even if they are deleted? Here I’m going to teach you how to access your website data, so that you can check and delete both yours (and others😉🤪) website history. #relationshiptips #Couple #toxicrelationship #Lemon8 #christmas
Kristin🔆🔍

Kristin🔆🔍

54 likes

A laptop on a desk displays the Tabby Cat Chrome extension, featuring a cartoon cat with glasses and a coffee cup on a purple background. The image highlights "Aesthetic Chrome Extensions" for students and everyone.
A screenshot of the Catadoo Chrome extension shows a gamified to-do list with an orange cartoon cat. Tasks like "do some work" are visible, alongside user ratings and a description of the extension.
A screenshot of the Coffeelings Chrome extension, a mini journal and mood tracker, is displayed within a browser window. It shows a calendar interface for mood tracking and journal entries.
Aesthetic Chrome Extensions for Students Everyone
Change your browsing experience with these whimsical Chrome extensions, perfect for students and everyone seeking a dash of joy in their digital lives! 🐾 Catadoo: The Gamified Todo List 🐾 Say goodbye to mundane to-do lists and welcome Catadoo, where tasks come to life with the adorable Turbo th
Reverelia

Reverelia

782 likes

An iPad displays digital notes on JavaScript and the DOM, with a pink stylus, keyboard, and headphones in the background. The image is titled 'HOW TO TAKE NOTES LIKE A PRO On your ipad' and promotes the 'NOTES+ APP'.
An iPad shows a digital note-taking app interface with various color palettes for pens and highlighters. The text 'Set your aesthetic SET PEN AND HIGHLIGHTER TO COLORS YOU LIKE' is overlaid, along with several hex color codes.
An iPad displays a pop-up window within a note-taking app, prompting the user to 'Import Webpage' by pasting a link to convert it into a PDF for studying.
How to take notes like a straight-a student
Taking notes is essentials to learning and retreating info. i’ve always struggles taking notes until i made it to where I wanted to take notes and i truly enjoyed it. here’s what i did. ⭐️ Choose the colors that fits your aesthetic: - Set the highlighter & pen colors. ✨I love that the hig
Byaombe •••

Byaombe •••

364 likes

Skills You Need For WEB DEVELOPMENT!!
💻If you've ever wondered what you need to know to do web development then this post is for you! I have laid out the basics, frameworks, backend, design tools, and bonus tools that you will most likely need to learn to become a web developer! Websites are quite complicate and layered, and they
CompSkyy

CompSkyy

143 likes

Study For Hours With These Tricks!
Studying for hours can feel impossible sometimes, but I’ve learned to outsmart my own procrastination by using a few simple tricks. The first is the “5-minute rule.” Whenever I’m struggling to start, I tell myself, “I’ll just study for 5 minutes.” It’s such a small commitment that it feels easy to
CompSkyy

CompSkyy

350 likes

Resumé checklist: do NOT miss these! 📝
This may seem like basic advice, but I get a lot of DMs asking me to help review resumes and you’d be surprised how many people miss these key points! Keeping your resume updated is essential for reflecting your most recent skills, experiences, and achievements. Regular updates keep you in the r
Jane 🦧

Jane 🦧

85 likes

Data Structures & Algorithms Was EASY With These!
When I first started learning DSA, finding the right resources felt overwhelming. That’s why I want to share the playlists that made a huge difference for me! Abdul Bari’s Algorithms Course was a lifesaver—his clear and simple explanations helped me truly understand complex concepts like sorting
CompSkyy

CompSkyy

28 likes

A computer screen shows Pinterest with a browser extension popup titled "What runs au.pinterest.com?". The popup lists technologies like Facebook, React, Pinterest Tag, and webpack. A pink bunny figurine sits atop the monitor, with text overlay "How to find software running websites SWIPE TO VIEW."
Titled "From Frameworks to Fonts!", this image displays a browser extension popup detailing a website's tech stack. It shows analytics, programming languages, tag managers, web frameworks, web servers, and fonts. Text highlights that it reveals "Everything that runs a website" including frameworks, technologies, CMS, themes, and fonts.
Titled "WhatRuns", this image shows the Chrome Web Store page for the WhatRuns extension, indicating 400,000 users and a 3.8 rating. Below, a screenshot demonstrates the extension identifying technologies on a website. Text states, "Find out exactly what powers any website with WhatRuns—one click and you're in!"
✨ how to find software that runs any website
‧°𐐪♡𐑂°‧₊ 🍮 WhatRuns lets you easily see the tech stack behind any website, which can be really useful if you're a student or creator trying to understand web development. With just one click, you can uncover frameworks, fonts, plugins, and more—plus, it tracks any changes the site makes to it
peachiesuga ♡

peachiesuga ♡

382 likes

These sites saved my brain in 2025 🧠💻
1. ChatHub I used to bounce between AI platforms, copy-pasting the same prompt over and over to compare answers. With ChatHub, I can talk to multiple AIs at the same time, in one clean interface. It’s honestly my go-to whenever I’m brainstorming content, writing study scripts, or just curious whi
emilie.studygram

emilie.studygram

563 likes

A man with tattoos and a cap sits at a desk, coding on a large monitor in a dimly lit room. Text overlays read 'SWIPE', 'Learning JavaScript?', and 'This is for YOU!', with a thinking emoji, promoting coding education.
A man with headphones and a cap codes at a desk with a large monitor displaying code. Text overlays read 'SWIPE', 'Break vs Continue', and 'In JS loops', with a thinking emoji, highlighting JavaScript loop concepts.
A man with headphones and a cap sits at a desk, coding on a large monitor in a bright room. Text overlays read 'Let's Discuss!' with a thinking emoji, inviting interaction about coding topics.
Coding W/ JavaScript?
As a software engineer w/ ADHD, understanding the difference between certain syntax keywords is critical, such as ‘continue’ and ‘break’ within JavaScript loops.💡 It’s almost like centering a <div> — it takes practice to feel confident in your abilities. 🛠️ When my mind gets stuck in a
Michael Burbank

Michael Burbank

13 likes

AI taught me to code faster than any course.
💡 Tired of watching endless tutorials and still getting stuck? I used to spend hours Googling every coding error—until I found BootSelf, the AI coding mentor that actually teaches you like a human would. This isn’t a course. It’s a 24/7 AI mentor that: ✅ Explains code in real time ✅ Reviews a
Code with BootSelf AI

Code with BootSelf AI

9 likes

See more