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 987293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:27:20+00:00 2026-05-16T05:27:20+00:00

New to javascript, I face many problems. I read the javascript tutorial at w3cschools.com,

  • 0

New to javascript, I face many problems.

I read the javascript tutorial at w3cschools.com,
and there are many question marks on my head.

I do not understand what is the difference below:

var name=something;

name=something;

The above two examples also giving something to a name, why 2 different ways?

name=new Array();

name[0]=something0;

name[1]=something1;

is this same with switch?

//switch start

var name=something();

switch(something)

{

case 1:

do something;

break;

case 2:

do something;

break;

default:

do something;

}

//if…else start

var name=something();

if (condition) 

{

do something

};

else if (condition)

{

do something

};

else

{

do something

};

what is the different between switch case and else.if ?

i think both 2 is doing the same thing?match condition and then do something?

and the for Loops,while Loops and break Loops ,

both 3 are doing the same thing,but 3 different ways.

can someone tell me what is the different between them?it make me confuse.

and please intro more tutorial for javascript.

many thanks here

  • 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-05-16T05:27:20+00:00Added an answer on May 16, 2026 at 5:27 am

    In answer to your first question:

    var name=something;
    
    name=something;
    

    var name

    This snippet creates a new variable, called name. It will be refered to in the rest of your code as name, it has been declared.

    var name = something

    This piece of code assumes that there is a variable declared above it called ‘something’, and it creates the name variable and assigns it the value of whatever ‘soemething’ holds at that particular point.

    name = something

    Without the intitial creation of the variable, this line assumes that the variable has already been declared previously, it is simply assigning that variable the value or something.

    Reading

    I recommend you read this webpage which appears to have a great introduction to javascript and will answer many more of your questions.

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

Sidebar

Related Questions

This question continues on from this question: Read url and output new javascript src
im new at javascript and i can get this slider to work but not
I am studying this page: http://www.fxstreet.com/rates-charts/currency-rates/ which is continually updated by JavaScript with new
What is the benefit of the new Javascript OData library over using jQuery? http://blogs.msdn.com/b/astoriateam/archive/2011/02/08/new-javascript-library-for-odata-and-beyond.aspx
I was checking out HTML5 new javascript commands and there is something similar to:
I am trying out this example http://thinkdiff.net/facebook/new-javascript-sdk-oauth-2-0-based-fbconnect-tutorial/ But I am getting xml error which
I'm relatively new javascript, but I am comfortable in other languages. I'm trying to
I'm using Nodejs and Socket.io. When the client connects, new JavaScript objects are created.
New to javascript and such, trying to create a loop for fading logos using
New to javascript, but I'm sure this is easy. Unfortunately, most of the google

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.