Movatterモバイル変換


[0]ホーム

URL:


Skip to Content
Articles

JavaScript Guide: Introduction to JavaScript

Console

The string,Hello!, is being printed to the console.

Output:

Hello!

Comments

Use two forward slashes// for a single-line comment.Use/* at the start and*/ at the end of a multi-line comment.

Single-line comment:

Multi-line comment:

Data Types

String

Number

Boolean

Null

Arithmetic Operators

Output:

1241525

String Concatenation

Output:

New York

Properties

Appending thelength property on the instance of a string returns the number of characters in that string.

Output:

10

Methods

Calling the.toUpperCase()method on the string instance returns the string in all capital letters.

Output:

CODECADEMY

Built-in Objects

Calling the.ceil() method on the built-inMath object returns the next whole number rounded up.

console.log(Math.ceil(43.8));

Output:

44
Codecademy Team

'The Codecademy Team, composed of experienced educators and tech experts, is dedicated to making tech skills accessible to all. We empower learners worldwide with expert-reviewed content that develops and enhances the technical skills needed to advance and succeed in their careers.'

Meet the full team

Related articles

Learn more on Codecademy

  • Take your JavaScript knowledge to the next level by learning how to use advanced functions to create more efficient programs.
    • Intermediate.
      11 hours
  • Contents

    [8]ページ先頭

    ©2009-2025 Movatter.jp