0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

JavaScript オブジェクト初級

Posted at

オブジェクトの勉強

連絡帳を作る

入力してもらう内容を入れる変数を作る


<script>
const user_name = prompt('なまーえ');
const user_age = prompt('なんさい?');
const user_area = prompt('どこすみ?');
const user_hobby = prompt('しゅみは?');

オブジェトに格納する


const user = {};

user.name = user_name;
user.age = user_age;
user.area = user_area;
user.hobby = user_hobby;

オブジェクトをコンソールに表示する


console.log(user);

</script>
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?