JavaScript Basics: Fundamental Syntax, Part 2 Flashcards

1
Q

//

A
  • use slash slash to add comments to program, program won’t run it
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

variables

A
  • var (declare a variable)
  • if (JavaScript makes a test), test whether input is really day
  • if (test.Input.length == 0)// == test is something is equal to something
  • if if var is true then we get if element and we get else var if if var is false
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How would someone declare a variable called “input” and set its initial value to “56”?

A
var input = 56;
- Var declares a particular variable (in this case "input") and then the assignment operator ("=") is used to set it to a value - in the case of this example "56".
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The content of functions must be placed within what?

A
  • { }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly