Results 1 to 4 of 4
  1. #1
    Firstin is offline Member
    Join Date
    Jan 2014
    Posts
    2
    Rep Power
    0

    Question Learner questions!!!

    Hi Guys

    Can somebody please tell my the following alert returns an added string instead of adding the var together to give me a total?

    var tvHours = prompt('How many hours of Tv do you watch last week?');
    var webHours = prompt('How many hours of internet surfing did you do last week?');
    var gameHours = prompt('How many hours of video games did you play last week?');

    alert(tvHours + webHours + gameHours);

    Also can you store a var in an alert? e.g ( var time = alert(tvHours + webHours + gameHours); ???

    Sorry for the noob questions :)

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default Re: Learner questions!!!

    Uhm javascript != java.

    JavaScript is NOT Java, find a javascript forum.

  3. #3
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,703
    Rep Power
    5

    Default Re: Learner questions!!!

    lol :) First thing to do: stop mashing the keyboard and figure out what this thing you're trying to use actually IS. Stop being an actual noob and become a proper novice.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  4. #4
    Firstin is offline Member
    Join Date
    Jan 2014
    Posts
    2
    Rep Power
    0

    Default Re: Learner questions!!!

    Lol!!!! Just tricking??? :) told you was a noob question!

Similar Threads

  1. Questions about app
    By newProgrammer in forum Android
    Replies: 0
    Last Post: 10-16-2012, 05:42 PM
  2. [Learner] Little project
    By N0VA in forum Jobs Wanted
    Replies: 0
    Last Post: 12-09-2010, 10:07 PM
  3. pong game with reinforcement learner
    By jackdalton in forum New To Java
    Replies: 7
    Last Post: 11-12-2010, 06:10 PM
  4. Java Learner
    By Natty in forum New To Java
    Replies: 2
    Last Post: 04-14-2010, 06:15 AM
  5. new learner..
    By coolymeimei in forum New To Java
    Replies: 1
    Last Post: 04-09-2009, 10:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •