JavaScript VARIABLES AND DATA TYPES. OUTPUT WITHOUT ALERT OR FORM CONSOLE.LOG();

Slides:



Advertisements
Similar presentations
Adding and Subtracting Polynomials Whats a polynomial?
Advertisements

This is Java Jeopardy.
This Time Whitespace and Input/Output revisited The Programming cycle Boolean Operators The “if” control structure LAB –Write a program that takes an integer.
 Basically, it’s a sequence of characters.  Character? › Like… a letter. › Or a number. › Or even blank space (like spaces tabs and newlines).
 Basically, a sequence of characters  Character? › Like… a letter › Or a number › Or even blank space.
The Class String. String Constants and Variables  There is no primitive type for strings in Java.  There is a class called String that can be used to.
Characters and Strings. Characters In Java, a char is a primitive type that can hold one single character A character can be: –A letter or digit –A punctuation.
JAVASCRIPT TIPS. REMEMBER JAVASCRIPT IS VERY, VERY CASE SENSITIVE.
Variables & Math Operators CE 311 K - Introduction to Computer Methods Daene C. McKinney.
PHP : Hypertext Preprocessor
2440: 211 Interactive Web Programming Expressions & Operators.
Operators, Functions and Modules1 Pattern Matching & Recursion.
Constants in C A Presentation On Department of Computer & Information Technology, M.S.P.V.L. Polytechnic College, Pavoorchatram.
Unit 3: Java Data Types Math class and String class.
The Distributive Property allows you to multiply each number inside a set of parenthesis by a factor outside the parenthesis and find the sum or difference.
20-753: Fundamentals of Web Programming 1 Lecture 12: Javascript I Fundamentals of Web Programming Lecture 12: Introduction to Javascript.
C++ Character Set It is set of Characters/digits/symbol which is valid in C++. Example – A-Z, (white space) C++ Character Set It is set of.
ROUND 1 Name a method associated with class String 1.) 15 compareTo() 26 indexOf() 34 length() 2.) 3.) 4.) 3 toUpper() 7 substring() 11 charAt() 5.)
Working with Forms and Regular Expressions Validating a Web Form with JavaScript.
Primitive Data Types. Identifiers What word does it sound like?
Strings, output, quotes and comments
1 Cannon_Chapter9 Strings and the string Class. 2 Overview  Standards for Strings  String Declarations and Assignment  I/O with string Variables 
C++ Basics Tutorial 5 Constants. Topics Covered Literal Constants Defined Constants Declared Constants.
Programming in Java (COP 2250) Lecture 4 Chengyong Yang Fall, 2005.
Strings See Chapter 2 u Review constants u Strings, concatenation and repetition 1.
C++ for Everyone by Cay Horstmann Copyright © 2012 by John Wiley & Sons. All rights reserved Chapter Two: Fundamental Data Types Slides by Evan Gallagher.
Variables, Input, and Output. Challenge: ● Ask the user his or her name, and repeat that name to the user ● Pause video and try.
Strings The Basics. Strings a collection data type can refer to a string variable as one variable or as many different components (characters) string.
Programming Fundamentals. Today’s Lecture Multidimensional Arrays Arrays as Class Member Data Arrays of Objects C-Strings.
Chapter 2 print / println String Literals Escape Characters Variables / data types.
Values, Types, and Variables. Values Data Information Numbers Text Pretty much anything.
JavaScript Functions. CSS Inheritance Which formatting applies? x y z input { display: block; } input.pref { background:red; } If you have a selector.
Chapter 2 1.What is the difference between print / println 2.What are String Literals 3.What are the Escape Characters for backslash, double quotataions,
Chapter 2: Data and Expressions. Variable Declaration In Java when you declare a variable, you must also declare the type of information it will hold.
17-Mar-16 Characters and Strings. 2 Characters In Java, a char is a primitive type that can hold one single character A character can be: A letter or.
Modern JavaScript Develop And Design Instructor’s Notes Chapter 4 – Simple Variable Types Modern JavaScript Design And Develop Copyright © 2012 by Larry.
DEFINITION Java IDE created by Xinox Software JCreator is a powerful interactive development environment (IDE) for Java technologies. A Java compiler.
ENGINEERING 1D04 Tutorial 2. What we’re doing today More on Strings String input Strings as lists String indexing Slice Concatenation and Repetition len()
The Distributive Property
2 Understanding Variables and Solving Equations.
Variables and Data Types
Wel come.
JavaScript Objects.
Do Now Write down any math properties you know and give an example. (ex. Commutative) Write down any similarities or differences between expressions and.
You can use algebra tiles to model algebraic expressions.
More C++ Basics October 4, 2017.
JavaScript Functions.
JavaScript.
Introduction to Objects
Primitive Types Vs. Reference Types, Strings, Enumerations
String and StringBuilder
SAS in Data Cleaning.
3x 2x -5 x + 11 (4x + 7)° 90° (8x - 1)°.
String and StringBuilder
Learning Objectives String Class.
Reviewing key concepts
Variables and Data Types
String Concatenation Objectives
The Distributive Property
String and StringBuilder
Appendix B.1 Lex Appendix B.1 -- Lex.
Lab 5: Complex Inputs.
7 – Variables, Input and Output
Introduction to Computer Science
String methods 26-Apr-19.
Exam Prep.
getline() function with companion ignore()
Lex Appendix B.1 -- Lex.
What We Want To Do User enters: Mary Smith
Introduction to Objects
Presentation transcript:

JavaScript VARIABLES AND DATA TYPES

OUTPUT WITHOUT ALERT OR FORM CONSOLE.LOG();

Holding information

example A = B + C; Cubby Hole 2: add this value Cubby Hole 1: take this value Cubby Hole 3: place it here

Defining CUBBY HOLES  They are called variables  Define them  Give them values  Take values from them

= means “takes the value of” A takes the value of B+C

VALUES

What values can it take?  Any “expression”  What is an expression?  Variables  Constants  Operators  functions  Different for numbers and strings

Numbers  Regular math operators  Variables  Constants  Functions (random, floor)

Strings  Think of Scrabble tiles  Each tile is a  Letter  Number  Punctuation mark  Space (blank)

What is a String?  A literal string must be inside double quotes or single quotes  “this is a string” and this is not a string.  Remember to beware cut and paste

Concatenating (formally)  It means combining two or more things into one thing  + Anything can be concatenated  “awe” & “some” = “awesome”  Whitespace only matters inside quotes  “a”+“b” same as “a” = “b”  “a ” + “b” NOT the same as “a” + “b”

Substring  A substring is also a String  A substring is a part of another string  “cake” is a substring of “birthday cake”  so are “day”, “thd”, and “y cake”  “they” is not, neither is “hello” or “dude”  Will come back to how to extract substrings

Referencing characters Each character has a position Note that it starts at 0, not 1 HIMOM