JavaScript | 자바스크립트 | INTRODUCTION TO JAVASCRIPT 다섯번째
JavaScript | 자바스크립트 | INTRODUCTION TO JAVASCRIPT 다섯번째
Getting started with Programming | Codecademy
Five. Variables
24/28 Variables
File1 _ script.js
// To create a variable, we use only one equals sign// But to check if two values are equal, we use 3 equal signs.
// declare your variable here:
var myAge = 35;
console.log(myAge);
25/28 More Variable Practice
File1 _ script.js
// Declare a variable on line 3 called
// myCountry and give it a string value.
var myCountry = "Seoul";
// Use console.log to print out the length of the variable myCountry.
console.log(myCountry.length);
// Use console.log to print out the first three letters of myCountry.
console.log(myCountry.substring(0,3));
26/28 Change variable values
File1 _ script.js
// On line 2, declare a variable myName and give it your name.
var myName = "JONE STUDIO";
// On line 4, use console.log to print out the myName variable.
console.log(myName);
// On line 7, change the value of myName to be just the first 2
// letters of your name.
myName = "JO";
// On line 9, use console.log to print out the myName variable.
console.log(myName);
27/28 Conclusion: Part 1
File1 _ script.js
var myColor = "blue";
console.log(myColor.length);
28/28 Conclusion: Part 2
File1 _ script.js
// Not sure where to begin? Check the Hint!
if (1<2) {
console.log("I finished my first course!");
} else {
console.log("I finished my first course!");
}
Next Course: Choose Your Own Adventure!
