[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-871":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":46,"readmeContent":47,"aiSummary":48,"trendingCount":16,"starSnapshotCount":16,"syncStatus":49,"lastSyncTime":50,"discoverSource":51},871,"30-Days-Of-JavaScript","Asabeneh\u002F30-Days-Of-JavaScript","Asabeneh","30 days of JavaScript programming challenge is a step-by-step guide to learn JavaScript programming language in 30 days. This challenge may take more than 100 days,  please just follow your own pace. These videos may help too: https:\u002F\u002Fwww.youtube.com\u002Fchannel\u002FUC7PNRuno1rzYPb1xLa4yktw","",null,"JavaScript",46447,10439,846,118,0,5,35,113,29,104.5,false,"master",true,[26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],"30daysofjavascript","angular","challenge","css","d3","d3js","html","javascript","javascript-for-everyone","js","json","node","nodejs","programming","react","redux","typescript","vue","webdevelopment","website","2026-06-12 04:00:06","# 30 Days Of JavaScript\n\n \u003C!--  \u003Cstrong>Learn with Asabeneh by joining the upcoming [\u003Cem>CODING BOOTCAMP\u003C\u002Fem>](https:\u002F\u002Fdocs.google.com\u002Fforms\u002Fd\u002Fe\u002F1FAIpQLSf0oNIYR9XU1DCctfl-pY36KbWse-SQX5aQaUgetqSinFYnmQ\u002Fviewform) \u003C\u002Fstrong> -->\n\n\n| # Day |                                                                       Topics                                                                        |\n| ----- | :-------------------------------------------------------------------------------------------------------------------------------------------------: |\n| 01    |                                                             [Introduction](.\u002FreadMe.md)                                                             |\n| 02    |                                               [Data Types](.\u002F02_Day_Data_types\u002F02_day_data_types.md)                                                |\n| 03    |                             [Booleans, Operators, Date](.\u002F03_Day_Booleans_operators_date\u002F03_booleans_operators_date.md)                             |\n| 04    |                                            [Conditionals](.\u002F04_Day_Conditionals\u002F04_day_conditionals.md)                                             |\n| 05    |                                                     [Arrays](.\u002F05_Day_Arrays\u002F05_day_arrays.md)                                                      |\n| 06    |                                                       [Loops](.\u002F06_Day_Loops\u002F06_day_loops.md)                                                       |\n| 07    |                                                 [Functions](.\u002F07_Day_Functions\u002F07_day_functions.md)                                                 |\n| 08    |                                                    [Objects](.\u002F08_Day_Objects\u002F08_day_objects.md)                                                    |\n| 09    |                             [Higher Order Functions](.\u002F09_Day_Higher_order_functions\u002F09_day_higher_order_functions.md)                              |\n| 10    |                                           [Sets and Maps](.\u002F10_Day_Sets_and_Maps\u002F10_day_Sets_and_Maps.md)                                           |\n| 11    |                      [Destructuring and Spreading](.\u002F11_Day_Destructuring_and_spreading\u002F11_day_destructuring_and_spreading.md)                      |\n| 12    |                                  [Regular Expressions](.\u002F12_Day_Regular_expressions\u002F12_day_regular_expressions.md)                                  |\n| 13    |                             [Console Object Methods](.\u002F13_Day_Console_object_methods\u002F13_day_console_object_methods.md)                              |\n| 14    |                                         [Error Handling](.\u002F14_Day_Error_handling\u002F14_day_error_handling.md)                                          |\n| 15    |                                                    [Classes](.\u002F15_Day_Classes\u002F15_day_classes.md)                                                    |\n| 16    |                                                        [JSON](.\u002F16_Day_JSON\u002F16_day_json.md)                                                         |\n| 17    |                                            [Web Storages](.\u002F17_Day_Web_storages\u002F17_day_web_storages.md)                                             |\n| 18    |                                                  [Promises](.\u002F18_Day_Promises\u002F18_day_promises.md)                                                   |\n| 19    |                                                   [Closure](.\u002F19_Day_Closures\u002F19_day_closures.md)                                                   |\n| 20    |                                  [Writing Clean Code](.\u002F20_Day_Writing_clean_codes\u002F20_day_writing_clean_codes.md)                                   |\n| 21    |                                                          [DOM](.\u002F21_Day_DOM\u002F21_day_dom.md)                                                          |\n| 22    |                            [Manipulating DOM Object](.\u002F22_Day_Manipulating_DOM_object\u002F22_day_manipulating_DOM_object.md)                            |\n| 23    |                                        [Event Listeners](.\u002F23_Day_Event_listeners\u002F23_day_event_listeners.md)                                        |\n| 24    |                             [Mini Project: Solar System](.\u002F24_Day_Project_solar_system\u002F24_day_project_solar_system.md)                              |\n| 25    | [Mini Project: World Countries Data Visualization 1](.\u002F25_Day_World_countries_data_visualization_1\u002F25_day_world_countries_data_visualization_1.md) |\n| 26    | [Mini Project: World Countries Data Visualization 2](.\u002F26_Day_World_countries_data_visualization_2\u002F26_day_world_countries_data_visualization_2.md) |\n| 27    |                             [Mini Project: Portfolio](.\u002F27_Day_Mini_project_portfolio\u002F27_day_mini_project_portfolio.md)                             |\n| 28    |                          [Mini Project: Leaderboard](.\u002F28_Day_Mini_project_leaderboard\u002F28_day_mini_project_leaderboard.md)                          |\n| 29    |             [Mini Project: Animating characters](.\u002F29_Day_Mini_project_animating_characters\u002F29_day_mini_project_animating_characters.md)             |\n| 30    |                                     [Final Projects](.\u002F30_Day_Mini_project_final\u002F30_day_mini_project_final.md)                                      |\n\n  \u003C!-- \u003Cstrong>Learn with Asabeneh by joining the upcoming [\u003Cem>CODING BOOTCAMP\u003C\u002Fem>](https:\u002F\u002Fdocs.google.com\u002Fforms\u002Fd\u002Fe\u002F1FAIpQLSf0oNIYR9XU1DCctfl-pY36KbWse-SQX5aQaUgetqSinFYnmQ\u002Fviewform) \u003C\u002Fstrong> -->\n\n🧡🧡🧡 HAPPY CODING 🧡🧡🧡\n\n\u003Cdiv>\n\u003Ch2>💖 Sponsors\u003C\u002Fh2>\n\n\u003Cp>Our amazing sponsors for supporting my open-source contribution and the \u003Cstrong>30 Days of Challenge\u003C\u002Fstrong> series!\u003C\u002Fp>\n\n\u003Ch3>Current Sponsor\u003C\u002Fh3>\n\u003Chr \u002F>\n\u003Cdiv align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fref.wisprflow.ai\u002FMPMzRGE\" target=\"_blank\" rel=\"noopener noreferrer\">\n    \u003Cpicture>\n      \u003C!-- Dark mode -->\n      \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Fraw.githubusercontent.com\u002FAsabeneh\u002Fasabeneh\u002Fmaster\u002Fimages\u002FWispr_Flow-Logo-white.png\" \u002F>\n      \u003C!-- Light mode (fallback) -->\n      \u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002FAsabeneh\u002Fasabeneh\u002Fmaster\u002Fimages\u002FWispr_Flow-logo.png\"\n           width=\"400px\"\n           alt=\"Wispr Flow Logo\"\n           title=\"Wispr Flow\" \u002F>\n    \u003C\u002Fpicture>\n  \u003C\u002Fa>\n\n  \u003Ch1>\n    \u003Ca href=\"https:\u002F\u002Fref.wisprflow.ai\u002FMPMzRGE\" target=\"_blank\" rel=\"noopener noreferrer\">\n      Talk to code, stay in the Flow.\n    \u003C\u002Fa>\n  \u003C\u002Fh1>\n\n  \u003Ch2>\n    \u003Ca href=\"https:\u002F\u002Fref.wisprflow.ai\u002FMPMzRGE\" target=\"_blank\" rel=\"noopener noreferrer\">\n      Flow is built for devs who live in their tools. Speak and give more context, get better results.\n    \u003C\u002Fa>\n  \u003C\u002Fh2>\n\u003C\u002Fdiv>\n\n\n---\n\n### 🙌 Become a Sponsor\n\nYou can support this project by becoming a sponsor on **[GitHub Sponsors](https:\u002F\u002Fgithub.com\u002Fsponsors\u002Fasabeneh)** or through [PayPal](https:\u002F\u002Fwww.paypal.me\u002Fasabeneh).\n\nEvery contribution, big or small, makes a huge difference. Thank you for your support! 🌟\n\n---\n>\n\n\u003Cdiv align=\"center\">\n  \u003Ch1> 30 Days Of JavaScript: Introduction\u003C\u002Fh1>\n  \u003Ca class=\"header-badge\" target=\"_blank\" href=\"https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fasabeneh\u002F\">\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fstyle--5eba00.svg?label=LinkedIn&logo=linkedin&style=social\">\n  \u003C\u002Fa>\n  \u003Ca class=\"header-badge\" target=\"_blank\" href=\"https:\u002F\u002Ftwitter.com\u002FAsabeneh\">\n  \u003Cimg alt=\"Twitter Follow\" src=\"https:\u002F\u002Fimg.shields.io\u002Ftwitter\u002Ffollow\u002Fasabeneh?style=social\">\n  \u003C\u002Fa>\n\n\u003Csub>Author:\n\u003Ca href=\"https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fasabeneh\u002F\" target=\"_blank\">Asabeneh Yetayeh\u003C\u002Fa>\u003Cbr>\n\u003Csmall> January, 2020\u003C\u002Fsmall>\n\u003C\u002Fsub>\n\n\u003Cdiv>\n\n🇬🇧 [English](.\u002FreadMe.md)\n🇪🇸 [Spanish](.\u002FSpanish\u002Freadme.md)\n🇮🇹 [Italian](.\u002FItalian\u002FreadMe.md)\n🇷🇺 [Russian](.\u002FRU\u002FREADME.md)\n🇹🇷 [Turkish](.\u002FTurkish\u002FreadMe.md)\n🇦🇿 [Azerbaijan](.\u002FAzerbaijani\u002FreadMe.md)\n🇰🇷 [Korean](.\u002FKorea\u002FREADME.md)\n🇻🇳 [Vietnamese](.\u002FVietnamese\u002FREADME.md)\n🇵🇱 [Polish](.\u002FPolish\u002FreadMe.md)\n🇧🇷 [Portuguese](.\u002FPortuguese\u002FreadMe.md)\n\n\u003C\u002Fdiv>\n\n\u003C\u002Fdiv>\n\u003C\u002Fdiv>\n\n[Day 2 >>](.\u002F02_Day_Data_types\u002F02_day_data_types.md)\n\n![Thirty Days Of JavaScript](.\u002Fimages\u002Fday_1_1.png)\n\n- [30 Days Of JavaScript](#30-days-of-javascript)\n    - [🙌 Become a Sponsor](#-become-a-sponsor)\n- [📔 Day 1](#-day-1)\n  - [Introduction](#introduction)\n  - [Requirements](#requirements)\n  - [Setup](#setup)\n    - [Install Node.js](#install-nodejs)\n    - [Browser](#browser)\n      - [Installing Google Chrome](#installing-google-chrome)\n      - [Opening Google Chrome Console](#opening-google-chrome-console)\n      - [Writing Code on Browser Console](#writing-code-on-browser-console)\n        - [Console.log](#consolelog)\n        - [Console.log with Multiple Arguments](#consolelog-with-multiple-arguments)\n        - [Comments](#comments)\n        - [Syntax](#syntax)\n      - [Arithmetics](#arithmetics)\n    - [Code Editor](#code-editor)\n      - [Installing Visual Studio Code](#installing-visual-studio-code)\n      - [How to Use Visual Studio Code](#how-to-use-visual-studio-code)\n  - [Adding JavaScript to a Web Page](#adding-javascript-to-a-web-page)\n    - [Inline Script](#inline-script)\n    - [Internal Script](#internal-script)\n    - [External Script](#external-script)\n    - [Multiple External Scripts](#multiple-external-scripts)\n  - [Introduction to Data types](#introduction-to-data-types)\n    - [Numbers](#numbers)\n    - [Strings](#strings)\n    - [Booleans](#booleans)\n    - [Undefined](#undefined)\n    - [Null](#null)\n  - [Checking Data Types](#checking-data-types)\n  - [Comments Again](#comments-again)\n  - [Variables](#variables)\n- [💻 Day 1: Exercises](#-day-1-exercises)\n\n# 📔 Day 1\n\n## Introduction\n\n**Congratulations** on deciding to participate in 30 days of JavaScript programming challenge. In this challenge, you will learn everything you need to be a JavaScript programmer, and in general, the whole concept of programming. In the end of the challenge,  you will get a 30DaysOfJavaScript programming challenge completion certificate.  In order to get a certificate, you have to enroll to [DevOsome](https:\u002F\u002Fwww.devosome.com\u002F) which is an interactive and engaging online educational platform.\n\nIn case you need help or if you would like to help others you may join the dedicated [telegram group](https:\u002F\u002Ft.me\u002FThirtyDaysOfJavaScript). \n\n**A 30DaysOfJavaScript** challenge is a guide for both beginners and advanced JavaScript developers. Welcome to JavaScript. JavaScript is the language of the web. I enjoy using and teaching JavaScript and I hope you will do so too.\n\nIn this step by step JavaScript challenge, you will learn JavaScript, the most popular programming language in the history of mankind.\nJavaScript is used **_to add interactivity to websites, to develop mobile apps, desktop applications, games_** and nowadays JavaScript can be used for **server-side programming**,  **_machine learning_** and **_AI_**.\n\n**_JavaScript (JS)_** has increased in popularity in recent years and has been the leading\nprogramming language for last ten years and is the most used programming language on\nGitHub.\n\nThis challenge is easy to read, written in conversational English, engaging, motivating and at the same time, it is very demanding. You need to allocate much time to finish this challenge. If you are a visual learner, you may get the video lesson on \u003Ca href=\"https:\u002F\u002Fwww.youtube.com\u002Fchannel\u002FUC7PNRuno1rzYPb1xLa4yktw\"> Washera\u003C\u002Fa> YouTube channel. Subscribe the channel, comment and ask questions on YouTube vides and be proactive, the author will eventually notice you. \n\nThe author likes to hear your opinion about the challenge, share the author by expressing your thoughts about the 30DaysOfJavaScript challenge. You can leave your testimonial on this [link](https:\u002F\u002Fwww.asabeneh.com\u002Ftestimonials)\n\n## Requirements\n\nNo prior knowledge of programming is required to follow this challenge. You need only:\n\n1. Motivation\n2. A computer\n3. Internet\n4. A browser\n5. A code editor\n\n## Setup\n\nI believe you have the motivation and a strong desire to be a developer, a computer and Internet. If you have those, then you have everything to get started.\n\n### Install Node.js\n\nYou may not need Node.js right now but you may need it for later. Install [node.js](https:\u002F\u002Fnodejs.org\u002Fen\u002F).\n\n![Node download](images\u002Fdownload_node.png)\n\nAfter downloading double click and install\n\n![Install node](images\u002Finstall_node.png)\n\nWe can check if node is installed on our local machine by opening our device terminal or command prompt.\n\n```sh\nasabeneh $ node -v\nv12.14.0\n```\n\nWhen making this tutorial I was using Node version 12.14.0, but now the recommended version of Node.js for download is v14.17.6, by the time you use this material you may have a higher Node.js version.\n\n### Browser\n\nThere are many browsers out there. However, I strongly recommend Google Chrome.\n\n#### Installing Google Chrome\n\nInstall [Google Chrome](https:\u002F\u002Fwww.google.com\u002Fchrome\u002F) if you do not have one yet. We can write small JavaScript code on the browser console, but we do not use the browser console to develop applications.\n\n![Google Chrome](images\u002Fgoogle_chrome.png)\n\n#### Opening Google Chrome Console\n\nYou can open Google Chrome console either by clicking three dots at the top right corner of the browser, selecting _More tools -> Developer tools_ or using a keyboard shortcut. I prefer using shortcuts.\n\n![Opening chrome](images\u002Fopening_developer_tool.png)\n\nTo open the Chrome console using a keyboard shortcut.\n\n```sh\nMac\nCommand+Option+J\n\nWindows\u002FLinux:\nCtl+Shift+J\n```\n\n![Opening console](images\u002Fopening_chrome_console_shortcut.png)\n\nAfter you open the Google Chrome console, try to explore the marked buttons. We will spend most of the time on the Console. The Console is the place where your JavaScript code goes. The Google Console V8 engine changes your JavaScript code to machine code.\nLet us write a JavaScript code on the Google Chrome console:\n\n![write code on console](.\u002Fimages\u002Fjs_code_on_chrome_console.png)\n\n#### Writing Code on Browser Console\n\nWe can write any JavaScript code on the Google console or any browser console. However, for this challenge, we only focus on Google Chrome console. Open the console using:\n\n```sh\nMac\nCommand+Option+I\n\nWindows:\nCtl+Shift+I\n```\n\n##### Console.log\n\nTo write our first JavaScript code, we used a built-in function **console.log()**. We passed an argument as input data, and the function displays the output. We passed `'Hello, World'` as input data or argument in the console.log() function.\n\n```js\nconsole.log('Hello, World!')\n```\n\n##### Console.log with Multiple Arguments\n\nThe **`console.log()`** function can take multiple parameters separated by commas. The syntax looks like as follows:**`console.log(param1, param2, param3)`**\n\n![console log multiple arguments](.\u002Fimages\u002Fconsole_log_multipl_arguments.png)\n\n```js\nconsole.log('Hello', 'World', '!')\nconsole.log('HAPPY', 'NEW', 'YEAR', 2020)\nconsole.log('Welcome', 'to', 30, 'Days', 'Of', 'JavaScript')\n```\n\nAs you can see from the snippet code above, _`console.log()`_ can take multiple arguments.\n\nCongratulations! You wrote your first JavaScript code using _`console.log()`_.\n\n##### Comments\n\nWe can add comments to our code. Comments are very important to make code more readable and to leave remarks in our code. JavaScript does not execute the comment part of our code. In JavaScript, any text line starting with \u002F\u002F in JavaScript is a comment, and anything enclosed like this `\u002F\u002F` is also a comment.\n\n**Example: Single Line Comment**\n\n```js\n\u002F\u002F This is the first comment  \n\u002F\u002F This is the second comment  \n\u002F\u002F I am a single line comment\n```\n\n**Example: Multiline Comment**\n\n```js\n\u002F*\nThis is a multiline comment  \n Multiline comments can take multiple lines  \n JavaScript is the language of the web  \n *\u002F\n```\n\n##### Syntax\n\nProgramming languages are similar to human languages. English or many other language uses words, phrases, sentences, compound sentences and other more to convey a meaningful message. The English meaning of syntax is _the arrangement of words and phrases to create well-formed sentences in a language_. The technical definition of syntax is the structure of statements in a computer language. Programming languages have syntax. JavaScript is a programming language and like other programming languages it has its own syntax. If we do not write a syntax that JavaScript understands, it will raise different types of errors. We will explore different kinds of JavaScript errors later. For now, let us see syntax errors.\n\n![Error](images\u002Fraising_syntax_error.png)\n\nI made a deliberate mistake. As a result, the console raises syntax errors. Actually, the syntax is very informative. It informs what type of mistake was made. By reading the error feedback guideline, we can correct the syntax and fix the problem. The process of identifying and removing errors from a program is called debugging. Let us fix the errors:\n\n```js\nconsole.log('Hello, World!')\nconsole.log('Hello, World!')\n```\n\nSo far, we saw how to display text using the _`console.log()`_. If we are printing text or string using _`console.log()`_, the text has to be inside the single quotes, double quotes, or a backtick.\n**Example:**\n\n```js\nconsole.log('Hello, World!')\nconsole.log(\"Hello, World!\")\nconsole.log(`Hello, World!`)\n```\n\n#### Arithmetics\n\nNow, let us practice more writing JavaScript codes using _`console.log()`_ on Google Chrome console for number data types.\nIn addition to the text, we can also do mathematical calculations using JavaScript. Let us do the following simple calculations.\nIt is possible to write JavaScript code on Google Chrome console can directly without the **_`console.log()`_** function. However, it is included in this introduction because most of this challenge would be taking place in a text editor where the usage of the function would be mandatory. You can play around directly with instructions on the console.\n\n![Arithmetic](images\u002Farithmetic.png)\n\n```js\nconsole.log(2 + 3) \u002F\u002F Addition\nconsole.log(3 - 2) \u002F\u002F Subtraction\nconsole.log(2 * 3) \u002F\u002F Multiplication\nconsole.log(3 \u002F 2) \u002F\u002F Division\nconsole.log(3 % 2) \u002F\u002F Modulus - finding remainder\nconsole.log(3 ** 2) \u002F\u002F Exponentiation 3 ** 2 == 3 * 3\n```\n\n### Code Editor\n\nWe can write our codes on the browser console, but it won't be for bigger projects. In a real working environment, developers use different code editors to write their codes. In this 30 days of JavaScript challenge, we will be using Visual Studio Code.\n\n#### Installing Visual Studio Code\n\nVisual Studio Code is a very popular open-source text editor. I would recommend to [download Visual Studio Code](https:\u002F\u002Fcode.visualstudio.com\u002F), but if you are in favor of other editors, feel free to follow with what you have.\n\n![Vscode](images\u002Fvscode.png)\n\nIf you installed Visual Studio Code, let us start using it.\n\n#### How to Use Visual Studio Code\n\nOpen the Visual Studio Code by double-clicking its icon. When you open it, you will get this kind of interface. Try to interact with the labeled icons.\n\n![Vscode ui](.\u002Fimages\u002Fvscode_ui.png)\n\n![Vscode add project](.\u002Fimages\u002Fadding_project_to_vscode.png)\n\n![Vscode open project](.\u002Fimages\u002Fopening_project_on_vscode.png)\n\n![script file](images\u002Fscripts_on_vscode.png)\n\n![Installing Live Server](images\u002Fvsc_live_server.png)\n\n![running script](.\u002Fimages\u002Frunning_script.png)\n\n![coding running](.\u002Fimages\u002Flaunched_on_new_tab.png)\n\n## Adding JavaScript to a Web Page\n\nJavaScript can be added to a web page in three different ways:\n\n- **_Inline script_**\n- **_Internal script_**\n- **_External script_**\n- **_Multiple External scripts_**\n\nThe following sections show different ways of adding JavaScript code to your web page.\n\n### Inline Script\n\nCreate a project folder on your desktop or in any location, name it 30DaysOfJS and create an **_`index.html`_** file in the project folder. Then paste the following code and open it in a browser, for example [Chrome](https:\u002F\u002Fwww.google.com\u002Fchrome\u002F).\n\n```html\n\u003C!DOCTYPE html>\n\u003Chtml lang=\"en\">\n  \u003Chead>\n    \u003Ctitle>30DaysOfScript:Inline Script\u003C\u002Ftitle>\n  \u003C\u002Fhead>\n  \u003Cbody>\n    \u003Cbutton onclick=\"alert('Welcome to 30DaysOfJavaScript!')\">Click Me\u003C\u002Fbutton>\n  \u003C\u002Fbody>\n\u003C\u002Fhtml>\n```\n\nNow, you just wrote your first inline script. We can create a pop up alert message using the _`alert()`_ built-in function.\n\n### Internal Script\n\nThe internal script can be written in the _`head`_ or the _`body`_, but it is preferred to put it on the body of the HTML document.\nFirst, let us write on the head part of the page.\n\n```html\n\u003C!DOCTYPE html>\n\u003Chtml lang=\"en\">\n  \u003Chead>\n    \u003Ctitle>30DaysOfScript:Internal Script\u003C\u002Ftitle>\n    \u003Cscript>\n      console.log('Welcome to 30DaysOfJavaScript')\n    \u003C\u002Fscript>\n  \u003C\u002Fhead>\n  \u003Cbody>\u003C\u002Fbody>\n\u003C\u002Fhtml>\n```\n\nThis is how we write an internal script most of the time. Writing the JavaScript code in the body section is the most preferred option. Open the browser console to see the output from the `console.log()`.\n\n```html\n\u003C!DOCTYPE html>\n\u003Chtml lang=\"en\">\n  \u003Chead>\n    \u003Ctitle>30DaysOfScript:Internal Script\u003C\u002Ftitle>\n  \u003C\u002Fhead>\n  \u003Cbody>\n    \u003Cbutton onclick=\"alert('Welcome to 30DaysOfJavaScript!');\">Click Me\u003C\u002Fbutton>\n    \u003Cscript>\n      console.log('Welcome to 30DaysOfJavaScript')\n    \u003C\u002Fscript>\n  \u003C\u002Fbody>\n\u003C\u002Fhtml>\n```\n\nOpen the browser console to see the output from the `console.log()`.\n\n![js code from vscode](.\u002Fimages\u002Fjs_code_vscode.png)\n\n### External Script\n\nSimilar to the internal script, the external script link can be on the header or body, but it is preferred to put it in the body.\nFirst, we should create an external JavaScript file with .js extension. All files ending with .js extension are JavaScript files. Create a file named introduction.js inside your project directory and write the following code and link this .js file at the bottom of the body.\n\n```js\nconsole.log('Welcome to 30DaysOfJavaScript')\n```\n\nExternal scripts in the _head_:\n\n```html\n\u003C!DOCTYPE html>\n\u003Chtml lang=\"en\">\n  \u003Chead>\n    \u003Ctitle>30DaysOfJavaScript:External script\u003C\u002Ftitle>\n    \u003Cscript src=\"introduction.js\">\u003C\u002Fscript>\n  \u003C\u002Fhead>\n  \u003Cbody>\u003C\u002Fbody>\n\u003C\u002Fhtml>\n```\n\nExternal scripts in the _body_:\n\n```html\n\u003C!DOCTYPE html>\n\u003Chtml lang=\"en\">\n  \u003Chead>\n    \u003Ctitle>30DaysOfJavaScript:External script\u003C\u002Ftitle>\n  \u003C\u002Fhead>\n  \u003Cbody>\n    \u003C!-- JavaScript external link could be in the header or in the body --> \n    \u003C!-- Before the closing tag of the body is the recommended place to put the external JavaScript script -->\n    \u003Cscript src=\"introduction.js\">\u003C\u002Fscript>\n  \u003C\u002Fbody>\n\u003C\u002Fhtml>\n```\n\nOpen the browser console to see the output of the `console.log()`.\n\n### Multiple External Scripts\n\nWe can also link multiple external JavaScript files to a web page.\nCreate a `helloworld.js` file inside the 30DaysOfJS folder and write the following code.\n\n```js\nconsole.log('Hello, World!')\n```\n\n```html\n\u003C!DOCTYPE html>\n\u003Chtml lang=\"en\">\n  \u003Chead>\n    \u003Ctitle>Multiple External Scripts\u003C\u002Ftitle>\n  \u003C\u002Fhead>\n  \u003Cbody>\n    \u003Cscript src=\".\u002Fhelloworld.js\">\u003C\u002Fscript>\n    \u003Cscript src=\".\u002Fintroduction.js\">\u003C\u002Fscript>\n  \u003C\u002Fbody>\n\u003C\u002Fhtml>\n```\n\n_Your main.js file should be below all other scripts_. It is very important to remember this.\n\n![Multiple Script](.\u002Fimages\u002Fmultiple_script.png)\n\n## Introduction to Data types\n\nIn JavaScript and also other programming languages, there are different types of data types. The following are JavaScript primitive data types: _String, Number, Boolean, undefined, Null_, and _Symbol_.\n\n### Numbers\n\n- Integers: Integer (negative, zero and positive) numbers\n  Example:\n  ... -3, -2, -1, 0, 1, 2, 3 ...\n- Float-point numbers: Decimal number\n  Example\n  ... -3.5, -2.25, -1.0, 0.0, 1.1, 2.2, 3.5 ...\n\n### Strings\n\nA collection of one or more characters between two single quotes, double quotes, or backticks.\n\n**Example:**\n\n```js\n'a'\n'Asabeneh'\n\"Asabeneh\"\n'Finland'\n'JavaScript is a beautiful programming language'\n'I love teaching'\n'I hope you are enjoying the first day'\n`We can also create a string using a backtick`\n'A string could be just as small as one character or as big as many pages'\n'Any data type under a single quote, double quote or backtick is a string'\n```\n\n### Booleans\n\nA boolean value is either True or False. Any comparisons returns a boolean value, which is either true or false.\n\nA boolean data type is either a true or false value.\n\n**Example:**\n\n```js\ntrue \u002F\u002F if the light is on, the value is true\nfalse \u002F\u002F if the light is off, the value is false\n```\n\n### Undefined\n\nIn JavaScript, if we don't assign a value to a variable, the value is undefined. In addition to that, if a function is not returning anything, it returns undefined.\n\n```js\nlet firstName\nconsole.log(firstName) \u002F\u002F undefined, because it is not assigned to a value yet\n```\n\n### Null\n\nNull in JavaScript means an empty value.\n\n```js\nlet emptyValue = null\n```\n\n## Checking Data Types\n\nTo check the data type of a certain variable, we use the **typeof** operator. See the following example.\n\n```js\nconsole.log(typeof 'Asabeneh') \u002F\u002F string\nconsole.log(typeof 5) \u002F\u002F number\nconsole.log(typeof true) \u002F\u002F boolean\nconsole.log(typeof null) \u002F\u002F object type\nconsole.log(typeof undefined) \u002F\u002F undefined\n```\n\n## Comments Again\n\nRemember that commenting in JavaScript is similar to other programming languages. Comments are important in making your code more readable.\nThere are two ways of commenting:\n\n- _Single line commenting_\n- _Multiline commenting_\n\n```js\n\u002F\u002F commenting the code itself with a single comment\n\u002F\u002F let firstName = 'Asabeneh'; single line comment\n\u002F\u002F let lastName = 'Yetayeh'; single line comment\n```\n\nMultiline commenting:\n\n```js\n\u002F*\n  let location = 'Helsinki';\n  let age = 100;\n  let isMarried = true;\n  This is a Multiple line comment\n*\u002F\n```\n\n## Variables\n\nVariables are _containers_ of data. Variables are used to _store_ data in a memory location. When a variable is declared, a memory location is reserved. When a variable is assigned to a value (data), the memory space will be filled with that data. To declare a variable, we use _var_, _let_, or _const_ keywords.\n\nFor a variable that changes at a different time, we use _let_. If the data does not change at all, we use _const_. For example, PI, country name, gravity do not change, and we can use _const_. We will not use var in this challenge and I don't recommend you to use it. It is error prone way of declaring variable it has lots of leak. We will talk more about var, let, and const in detail in other sections (scope). For now, the above explanation is enough.\n\nA valid JavaScript variable name must follow the following rules:\n\n- A JavaScript variable name should not begin with a number.\n- A JavaScript variable name does not allow special characters except dollar sign and underscore.\n- A JavaScript variable name follows a camelCase convention.\n- A JavaScript variable name should not have space between words.\n\nThe following are examples of valid JavaScript variables.\n\n```js\nfirstName\nlastName\ncountry\ncity\ncapitalCity\nage\nisMarried\n\nfirst_name\nlast_name\nis_married\ncapital_city\n\nnum1\nnum_1\n_num_1\n$num1\nyear2020\nyear_2020\n```\n\nThe first and second variables on the list follows the camelCase convention of declaring in JavaScript. In this material, we will use camelCase variables(camelWithOneHump). We use CamelCase(CamelWithTwoHump) to declare classes, we will discuss about classes and objects in other section.\n\nExample of invalid variables:\n\n```js\n  first-name\n  1_num\n  num_#_1\n```\n\nLet us declare variables with different data types. To declare a variable, we need to use _let_ or _const_ keyword before the variable name. Following the variable name, we write an equal sign (assignment operator), and a value(assigned data).\n\n```js\n\u002F\u002F Syntax\nlet nameOfVariable = value\n```\n\nThe nameOfVriable is the name that stores different data of value. See below for detail examples.\n\n**Examples of declared variables**\n\n```js\n\u002F\u002F Declaring different variables of different data types\nlet firstName = 'Asabeneh' \u002F\u002F first name of a person\nlet lastName = 'Yetayeh' \u002F\u002F last name of a person\nlet country = 'Finland' \u002F\u002F country\nlet city = 'Helsinki' \u002F\u002F capital city\nlet age = 100 \u002F\u002F age in years\nlet isMarried = true\n\nconsole.log(firstName, lastName, country, city, age, isMarried)\n```\n\n```sh\nAsabeneh Yetayeh Finland Helsinki 100 true\n```\n\n```js\n\u002F\u002F Declaring variables with number values\nlet age = 100 \u002F\u002F age in years\nconst gravity = 9.81 \u002F\u002F earth gravity  in m\u002Fs2\nconst boilingPoint = 100 \u002F\u002F water boiling point, temperature in °C\nconst PI = 3.14 \u002F\u002F geometrical constant\nconsole.log(gravity, boilingPoint, PI)\n```\n\n```sh\n9.81 100 3.14\n```\n\n```js\n\u002F\u002F Variables can also be declaring in one line separated by comma, however I recommend to use a seperate line to make code more readble\nlet name = 'Asabeneh', job = 'teacher', live = 'Finland'\nconsole.log(name, job, live)\n```\n\n```sh\nAsabeneh teacher Finland\n```\n\nWhen you run _index.html_ file in the 01-Day folder you should get this:\n\n![Day one](.\u002Fimages\u002Fday_1.png)\n\n🌕 You are amazing! You have just completed day 1 challenge and you are on your way to greatness. Now do some exercises for your brain and muscle.\n\n# 💻 Day 1: Exercises\n\n1. Write a single line comment which says, _comments can make code readable_\n2. Write another single comment which says, _Welcome to 30DaysOfJavaScript_\n3. Write a multiline comment which says, _comments can make code readable, easy to reuse_\n   _and informative_\n\n4. Create a variable.js file and declare variables and assign string, boolean, undefined and null data types\n5. Create datatypes.js file and use the JavaScript **_typeof_** operator to check different data types. Check the data type of each variable\n6. Declare four variables without assigning values\n7. Declare four variables with assigned values\n8. Declare variables to store your first name, last name, marital status, country and age in multiple lines\n9. Declare variables to store your first name, last name, marital status, country and age in a single line\n10. Declare two variables _myAge_ and _yourAge_ and assign them initial values and log to the browser console.\n\n```sh\nI am 25 years old.\nYou are 30 years old.\n```\n\n🎉 CONGRATULATIONS ! 🎉\n\n[Day 2 >>](.\u002F02_Day_Data_types\u002F02_day_data_types.md)\n","30-Days-Of-JavaScript 是一个为期30天的JavaScript编程挑战项目，旨在通过系统化的学习路径帮助开发者掌握JavaScript编程语言。该项目涵盖了从基础数据类型到高级概念如类和错误处理等全面的知识点，并且每天都有特定的主题和实践任务，适合初学者逐步建立扎实的基础，同时也为有一定经验的开发者提供复习和深入理解的机会。此外，项目还提供了相关的视频教程链接以辅助学习。无论是希望进入前端开发领域的新手还是想要提升技能的在职程序员，都可以利用这个资源进行自学或作为培训材料使用。",2,"2026-06-11 02:39:54","top_all"]