Main content
Course: Resources > Unit 1
Lesson 3: Computer programming teachers- Programming content overview
- Tracking progress of programming students
- Classroom debugging guide
- Pair programming in the classroom
- Teaching guide: Intro to JS - Drawing Basics
- Teaching guide: Intro to JS - Coloring
- Teaching guide: Intro to JS - Variables
- Teaching guide: Intro to JS - Animation basics
- Teaching guide: Intro to JS - Interactive Programs
- Teaching guide: Intro to JS - Resizing with variable expressions
- Teaching guide: Intro to JS - Text and strings
- Teaching guide: Intro to JS - Functions
- Teaching guide: Intro to JS - Logic and if statements
- Teaching guide: Intro to JS - Looping
- Teaching guide: Intro to JS - Arrays
- Teaching guide: Intro to JS - Objects
- Teaching guide: Intro to JS - Object-oriented design
- Programming classroom handouts
- Additional programming projects
- Lesson plans: teaching programming in the classroom
- Programming case study: Encouraging cross-disciplinary projects
- Programming case study: Going beyond the KA curriculum
- Programming case study: Teaching an elementary school class
© 2024 Khan AcademyTerms of usePrivacy PolicyCookie Notice
Teaching guide: Intro to JS - Text and strings
This is a teaching guide for the Intro to JS lesson on Text and strings.
What the student will learn
- How to display text in their programs, with the
text()
command. - How to resize text using the
textSize()
command. - How to use variables to store strings of text.
- How to concatenate multiple strings of text together with variables, using the
+
operator.
The student will be able to write code like:
Where students struggle
- Students often forget to call
fill()
before displaying text. If they don’t call it, then their text will be transparent (invisible!). - Students may struggle with the syntax of strings - like using mismatched quotation marks (starting with a double quotation mark and ending with a single quotation mark) or often just leaving off quotation marks entirely (which confuses the program, as it will think it’s a variable).
- When students try to concatenate multiple strings together, they often forget to put a
+
sign between each of the strings. Encourage them to scan their code carefully to look for that type of problem.
Additional materials: Trivia questions
These can be fun to do as a class after everyone’s gotten through the lesson. They can also lead to discussion about which questions are the hardest. Play them on Quizizz.
Want to join the conversation?
- "Students often forget to call fill() before displaying text. If they don’t call it, then their text will be transparent (invisible!)."
Their text will be white on a white background. Either changing the background color, or the text color will show the text.(5 votes)- hi larry yes grate Question you do have to put fill in front of the text won't show even if you change the background(2 votes)