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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:18:16+00:00 2026-06-08T13:18:16+00:00

I don’t understand exactly what’s happening here, it seems that’s a syntax issue. Just

  • 0

I don’t understand exactly what’s happening here, it seems that’s a syntax issue. Just in case it might be helpful, I’m very new to Javascript, but I have experience with AS3.

On this code:

https://github.com/mrdoob/three.js/blob/master/examples/canvas_lines.html

Line 34 is:

camera, scene, renderer;

I assumed these were variable declarations on the global scope, and also that in line 42, those were variable declarations as well but on the scope of the init() function.

Line 42:

particles, particle;

Playing around a little with that code I realized that the script didn’t work if I declared the particle object on the global scope like that, but it works if i use it like that:

var particle;

And also that ir works well if I remove the line 42.

Why does it work like that? What’s going on?

Thanks

  • 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-08T13:18:17+00:00Added an answer on June 8, 2026 at 1:18 pm

    This code has been formatted poorly (imho). It’s not made clear, but:

    var mouseX = 0, mouseY = 0,
    
    windowHalfX = window.innerWidth / 2,
    windowHalfY = window.innerHeight / 2,
    
    SEPARATION = 200,
    AMOUNTX = 10,
    AMOUNTY = 10,
    
    camera, scene, renderer;
    

    This is one single var statement, with the commas continuing it over lines. This may answer the confusion and help you rearrange declarations.

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

Sidebar

Related Questions

Don't think that I'm mad, I understand how php works! That being said. I
Don't be frightened, its a very basic code. Just wanted to check with you
DON'T ASK WHY but... I have a regex that needs to be case insensitive
Don't be scared of the extensive code. The problem is general. I just provided
Don't know whats exactly going on, but it's definitely killing my time for nothing.
Don't overthink this - there's a very commonly used term and I ... have
Don't know what's wrong here, when I run the application it says Specified method
Don't have much to say, just can get into the event handler. XAML: <Grid>
Don't know why this is happening, but after submitting a form via JS (using
Don't worry, I'm not going to ask that question, yet again... I am wanting

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.