• Log In
  • Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Digital Systems

Department of Management Information Systems, Temple University

Digital Systems

MIS 2101.712 ■ Summer 2022 ■ Steven E. Sclarow, AIA
  • Home
  • About
    • Course Materials
    • Course Requirements
    • Email Policy
    • Grading
    • Gradebook
    • Instructor
    • Temple and COVID-19
    • Zoom Requirements
  • Canvas Content
  • Coding Files
  • Helpdesk
  • Zoom Links
  • Video Vault
  • Diamond Peer Corner
  • Posts

Question: 9

Ella Peltier - June 19, 2022 Leave a Comment

In JavaScript, a variable stores the data value that can be changed later on. To create a variable, use the “let” keyword followed by the name you want to give your variable. In JavaScript, you can either declare a variable or initialize one. The difference between these two terms is that when a variable is declared, the variable is registered using a given name within the corresponding scope (ex: inside a function). With initialization, when you declare a variable it is automatically initialized, which means memory is allocated for the variable by the JavaScript engine. There are a few rules / guidelines that come along when naming a variable in JavaScript which can include: your variable cannot start with a number, and spaces are not allowed. However, you can make your variables as long as you want and outside of the first character, your variable can include as many letters, numbers, and special characters as you want. The arithmetic operations in JavaScript include addition (+), subtraction (-), multiplication (*), division (/), and modulus (%). Addition adds two operands, subtraction subtracts the right operand with the left operand, multiplication multiplies two operands, division divides the right operand into the left operand with the result always being a floating-point number, and lastly, modulus divides the right operand into the left operand and returns the remainder. There are other arithmetic operations such as exponentiation, however the five arithmetic operations listed above are most commonly used in JavaScript. Concatenation is a very common task that allows you to combine separate strings together. Concatenation operators allow you to do this task and are coded as a + or +=. The + concatenation is used for concatenates two values, whereas the += adds the result of the expression to the end of the variable. The prompt () term lets you get input from the user. For example, you could use let myText = prompt(“Hello Earth”) to prompt the user with Hello Earth in a dialogue box. 

How to Prompt the User for Input in JavaScript - dummiesA Simple Explanation of JavaScript Variables: const, let, var

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

ANNOUNCEMENTS

Week 12 Questions

Loops tell the computer to run a function repeatedly. They are useful if … [More...] about Week 12 Questions

Weekly Questions: 13

When it comes to adding the structure to a web page HTML is used. When it … [More...] about Weekly Questions: 13

Week 11 Questions

The purpose of the if/else code in JavaScript is to execute a block of code … [More...] about Week 11 Questions

Weekly Questions: 12

Loops are a sequence of instructions that is repeated until a certain … [More...] about Weekly Questions: 12

Week 10 Questions

A function in JavaScript is a set of instructions that performs a task or … [More...] about Week 10 Questions

Week 9 Questions

A variable in JavaScript is the name of a storage location for data. For … [More...] about Week 9 Questions

Instructor

Steven E. Sclarow, AIA

Email: sclarow@temple.edu
Virtual Office Hour Availability: Tue, 10 - 11:00 AM, or by appointment. Please email me to schedule an appointment outside of my normal office hours.
Virtual Office: https://temple.zoom.us/j/94115790056

ITA CONTACT INFO

ITA
Name: Anna Boykis
Email: anna.boykis@temple.edu
ITA
Name: Jessica Rakhman
Email: jessica.rakhman@temple.edu

Helpful Links

FOX Laptop Policy
FOX Laptop Support

Gradebook

Installing-VS-Code-Windows
Installing-VS-Code-Mac-OS

Copyright © 2025 · Department of Management Information Systems · Fox School of Business · Temple University