Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8552307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:23:47+00:00 2026-06-11T14:23:47+00:00

For learning purposes I’m building a simple messaging program that I think can work

  • 0

For learning purposes I’m building a simple messaging program that I think can work with local storage. Another question about 2 dimensional arrays is in the comments.

<!DOCTYPE HTML> 
    <html>     
        <head>             
            <title>waGwan?</title>     
            <meta charset="utf-8"/>
            <link rel=stylesheet href=comm.css></link>       
        </head>     
            <body>                              
                <section>
                    <p>enter or create passcode: <input type=text id=passcode></p>
                    <input type=button id="button" value="send">
                </section>
                <section id="log"></section>
                <script type="text/javascript">
                    //initializing my passcode. Pass is a two dimensional array that holds passcodes and arrays of corresponding message logs; how can I instantiate my passcode without nil but maintain pass as a two dimensional array, just not include pass?
                    var pass=[mypasscode,nil];
                    document.getElementById("button").onclick=checkPass;
                    function checkPass(){
                        for(i=0;i<pass.length;i++){
                            //exits if passcode exists
                            if(document.getElementById("passcode").value==pass[i]){
                                break;
                            }
                            //if passcode doesn't equal last existing passcode the passcode and a new array (that stores the message log) is added to the pass array
                            else if(document.getElementById("passcode").value!==pass[pass.length-1]){
                                pass.push(document.getElementById("passcode").value,[We can chat here.]);
                            }
                        }
                        document.write("x");
                    }
                </script>
            </body> 
    </html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T14:23:49+00:00Added an answer on June 11, 2026 at 2:23 pm
      pass.push(document.getElementById("passcode").value,[We can chat here.]);
    
                                                           ^^^^^^^^^^^^^^^^^^^
                                                            here is the problem   
    

    try this

    pass.push(document.getElementById("passcode").value,["We can chat here."]);
    

    you can use ide like neatbean which will warn you it there is any error like below

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi all I want to write a simple program (just for learning purposes) that
I am building a simple echo server for the purposes of learning the fundamentals
This question is for learning purposes. Suppose I am writing a simple SQL admin
For learning purposes, I want to make a simple archive format where I can
For learning purposes I'm trying to implement a simple play application that gets data
So this question is purely for learning purposes and curiosity, but can anyone explain
I am building a really simple groupon like script for learning purposes now in
I'm writing an instant messaging server in C# for learning purposes. My question is
I have a program that I am reverse engineering for learning purposes about protocols
I'm creating a simple messaging system (for learning purposes) where a user enters their

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.