diff --git a/files/en-us/learn_web_development/core/scripting/arrays/index.md b/files/en-us/learn_web_development/core/scripting/arrays/index.md index f7972bd034c7a8a..3d6e7f5cd18fc78 100644 --- a/files/en-us/learn_web_development/core/scripting/arrays/index.md +++ b/files/en-us/learn_web_development/core/scripting/arrays/index.md @@ -5,7 +5,7 @@ page-type: learn-module-chapter sidebar: learnsidebar --- -{{PreviousMenuNext("Learn_web_development/Core/Scripting/Useful_string_methods", "Learn_web_development/Core/Scripting/Silly_story_generator", "Learn_web_development/Core/Scripting")}} +{{PreviousMenuNext("Learn_web_development/Core/Scripting/Test_your_skills/Strings", "Learn_web_development/Core/Scripting/Test_your_skills/Arrays", "Learn_web_development/Core/Scripting")}} In this lesson we'll look at arrays — a neat way of storing a list of data items under a single variable name. Here we look at why this is useful, then explore how to create an [array](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array), retrieve, add, and remove items stored in an array, and more besides. @@ -493,19 +493,15 @@ searchBtn.addEventListener("click", () => { -## Test your skills! - -You've reached the end of this article, but can you remember the most important information? You can find some further tests to verify that you've retained this information before you move on — see [Test your skills: Arrays](/en-US/docs/Learn_web_development/Core/Scripting/Test_your_skills/Arrays). - -## Conclusion +## Summary After reading through this article, we are sure you will agree that arrays seem pretty darn useful; you'll see them crop up everywhere in JavaScript, often in association with loops in order to do the same thing to every item in an array. We'll be teaching you all about loops later on in the module. -In the next article we're giving you a challenge to test your understanding of the articles that came before it. +In the next article, we'll give you some tests that you can use to check how well you've understood and retained the information we've provided on arrays. ## See also - {{jsxref("Array")}} - : The `Array` object reference page provides a detailed reference guide to the features discussed in this page, and many other `Array` features. -{{PreviousMenuNext("Learn_web_development/Core/Scripting/Useful_string_methods", "Learn_web_development/Core/Scripting/Silly_story_generator", "Learn_web_development/Core/Scripting")}} +{{PreviousMenuNext("Learn_web_development/Core/Scripting/Test_your_skills/Strings", "Learn_web_development/Core/Scripting/Test_your_skills/Arrays", "Learn_web_development/Core/Scripting")}} diff --git a/files/en-us/learn_web_development/core/scripting/conditionals/index.md b/files/en-us/learn_web_development/core/scripting/conditionals/index.md index b386240987d644c..78260784c1fe3b6 100644 --- a/files/en-us/learn_web_development/core/scripting/conditionals/index.md +++ b/files/en-us/learn_web_development/core/scripting/conditionals/index.md @@ -6,7 +6,7 @@ page-type: learn-module-chapter sidebar: learnsidebar --- -{{PreviousMenuNext("Learn_web_development/Core/Scripting/Silly_story_generator", "Learn_web_development/Core/Scripting/Loops", "Learn_web_development/Core/Scripting")}} +{{PreviousMenuNext("Learn_web_development/Core/Scripting/Silly_story_generator", "Learn_web_development/Core/Scripting/Test_your_skills/Conditionals", "Learn_web_development/Core/Scripting")}} In any programming language, the code needs to make decisions and carry out actions accordingly depending on different inputs. For example, in a game, if the player's number of lives is 0, then it's game over. In a weather app, if it is being looked at in the morning, show a sunrise graphic; show stars and a moon if it is nighttime. In this article, we'll explore how so-called conditional statements work in JavaScript. @@ -693,13 +693,9 @@ function update(bgColor, textColor) { -## Test your skills! - -You've reached the end of this article, but can you remember the most important information? You can find some further tests to verify that you've retained this information before you move on — see [Test your skills: Conditionals](/en-US/docs/Learn_web_development/Core/Scripting/Test_your_skills/Conditionals). - ## Summary -That's all you really need to know about conditional structures in JavaScript right now! Next up, we'll look at looping through code. +That's all you really need to know about conditional structures in JavaScript right now! In the next article, we'll give you some tests that you can use to check how well you've understood and retained this information. ## See also @@ -708,4 +704,4 @@ That's all you really need to know about conditional structures in JavaScript ri - [if...else reference](/en-US/docs/Web/JavaScript/Reference/Statements/if...else) - [Conditional (ternary) operator reference](/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_operator) -{{PreviousMenuNext("Learn_web_development/Core/Scripting/Silly_story_generator", "Learn_web_development/Core/Scripting/Loops", "Learn_web_development/Core/Scripting")}} +{{PreviousMenuNext("Learn_web_development/Core/Scripting/Silly_story_generator", "Learn_web_development/Core/Scripting/Test_your_skills/Conditionals", "Learn_web_development/Core/Scripting")}} diff --git a/files/en-us/learn_web_development/core/scripting/debugging_javascript/index.md b/files/en-us/learn_web_development/core/scripting/debugging_javascript/index.md index 625c3469bdf7d3c..9ac24a638ce7f82 100644 --- a/files/en-us/learn_web_development/core/scripting/debugging_javascript/index.md +++ b/files/en-us/learn_web_development/core/scripting/debugging_javascript/index.md @@ -6,7 +6,7 @@ page-type: learn-module-chapter sidebar: learnsidebar --- -{{PreviousMenuNext("Learn_web_development/Core/Scripting/JSON","Learn_web_development/Core/Frameworks_libraries", "Learn_web_development/Core/Scripting")}} +{{PreviousMenuNext("Learn_web_development/Core/Scripting/Test_your_skills/JSON","Learn_web_development/Core/Frameworks_libraries", "Learn_web_development/Core/Scripting")}} In this lesson, we will return to the subject of debugging JavaScript (which we first looked at in [What went wrong?](/en-US/docs/Learn_web_development/Core/Scripting/What_went_wrong)). Here we will delve deeper into techniques for tracking down errors, but also look at how to code defensively and handle errors in your code, avoiding problems in the first place. @@ -364,4 +364,4 @@ So that's JavaScript debugging and error handling. Simple huh? Maybe not so simp That's it for the Dynamic scripting with JavaScript module; congratulations on reaching the end! In the next module we'll help you explore JavaScript frameworks and libraries. -{{PreviousMenuNext("Learn_web_development/Core/Scripting/JSON","Learn_web_development/Core/Frameworks_libraries", "Learn_web_development/Core/Scripting")}} +{{PreviousMenuNext("Learn_web_development/Core/Scripting/Test_your_skills/JSON","Learn_web_development/Core/Frameworks_libraries", "Learn_web_development/Core/Scripting")}} diff --git a/files/en-us/learn_web_development/core/scripting/dom_scripting/index.md b/files/en-us/learn_web_development/core/scripting/dom_scripting/index.md index 132f2ef410bf5dc..f95e98b91e572bf 100644 --- a/files/en-us/learn_web_development/core/scripting/dom_scripting/index.md +++ b/files/en-us/learn_web_development/core/scripting/dom_scripting/index.md @@ -6,7 +6,7 @@ page-type: learn-module-chapter sidebar: learnsidebar --- -{{PreviousMenuNext("Learn_web_development/Core/Scripting/Object_basics","Learn_web_development/Core/Scripting/Network_requests", "Learn_web_development/Core/Scripting")}} +{{PreviousMenuNext("Learn_web_development/Core/Scripting/Test_your_skills/Object_basics","Learn_web_development/Core/Scripting/Network_requests", "Learn_web_development/Core/Scripting")}} When writing web pages and apps, one of the most common things you'll want to do is change the document structure in some way. This is usually done by manipulating the Document Object Model (DOM) via a set of built-in browser APIs for controlling HTML and styling information. In this article we'll introduce you to **DOM scripting**. @@ -354,4 +354,4 @@ We have reached the end of our study of document and DOM manipulation. At this p - {{domxref("HTMLElement")}}, {{domxref("HTMLInputElement")}}, {{domxref("HTMLImageElement")}}, etc. - [DOM Scripting](https://explainers.dev/dom-scripting/), explainers.dev -{{PreviousMenuNext("Learn_web_development/Core/Scripting/Object_basics","Learn_web_development/Core/Scripting/Network_requests", "Learn_web_development/Core/Scripting")}} +{{PreviousMenuNext("Learn_web_development/Core/Scripting/Test_your_skills/Object_basics","Learn_web_development/Core/Scripting/Network_requests", "Learn_web_development/Core/Scripting")}} diff --git a/files/en-us/learn_web_development/core/scripting/event_bubbling/index.md b/files/en-us/learn_web_development/core/scripting/event_bubbling/index.md index e287df0f1144468..55331c3df2ec17e 100644 --- a/files/en-us/learn_web_development/core/scripting/event_bubbling/index.md +++ b/files/en-us/learn_web_development/core/scripting/event_bubbling/index.md @@ -5,7 +5,7 @@ page-type: learn-module-chapter sidebar: learnsidebar --- -{{PreviousMenuNext("Learn_web_development/Core/Scripting/Events","Learn_web_development/Core/Scripting/Image_gallery", "Learn_web_development/Core/Scripting")}} +{{PreviousMenuNext("Learn_web_development/Core/Scripting/Events","Learn_web_development/Core/Scripting/Test_your_skills/Events", "Learn_web_development/Core/Scripting")}} We've seen that a web page is composed of _elements_ — headings, paragraphs of text, images, buttons, and so on — and that you can listen for events that happen to these elements. For example, you could add a listener to a button, and it will run when the user clicks the button. @@ -408,21 +408,13 @@ Note that when we click the button, `target` is the button element every time, w {{embedlivesample("target and currentTarget")}} -The `target` property is commonly used in event delegation, as in our [Event delegation](#event_delegation) example above. - -## Test your skills! - -You've reached the end of this article, but can you remember the most important information? To verify you've retained this information before you move on — see [Test your skills: Events](/en-US/docs/Learn_web_development/Core/Scripting/Test_your_skills/Events). +The `target` property is commonly used in event delegation, as seen in our [Event delegation](#event_delegation) example above. ## Summary -You should now know all you need to know about web events at this early stage. -As mentioned, events are not really part of the core JavaScript — they are defined in browser Web APIs. - -Also, it is important to understand that the different contexts in which JavaScript is used have different event models — from Web APIs to other areas such as browser WebExtensions and Node.js (server-side JavaScript). -We are not expecting you to understand all of these areas now, but it certainly helps to understand the basics of events as you forge ahead with learning web development. +You should now know all you need to know about web events at this early stage. As mentioned, events are not really part of the core JavaScript language — they are defined in browser Web APIs. -Next up, you'll find a challenge that will test your understanding of the last few topics. +In the next article, we'll give you some tests that you can use to check how well you've understood and retained all the information we've given you on events. ## See also @@ -433,4 +425,4 @@ Next up, you'll find a challenge that will test your understanding of the last f - [Event order](https://www.quirksmode.org/js/events_order.html) - : An excellently detailed discussion of capturing and bubbling by Peter-Paul Koch. -{{PreviousMenuNext("Learn_web_development/Core/Scripting/Events","Learn_web_development/Core/Scripting/Image_gallery", "Learn_web_development/Core/Scripting")}} +{{PreviousMenuNext("Learn_web_development/Core/Scripting/Events","Learn_web_development/Core/Scripting/Test_your_skills/Events", "Learn_web_development/Core/Scripting")}} diff --git a/files/en-us/learn_web_development/core/scripting/events/index.md b/files/en-us/learn_web_development/core/scripting/events/index.md index 218995fcfa8ccc9..922763e5884794d 100644 --- a/files/en-us/learn_web_development/core/scripting/events/index.md +++ b/files/en-us/learn_web_development/core/scripting/events/index.md @@ -6,7 +6,7 @@ page-type: learn-module-chapter sidebar: learnsidebar --- -{{PreviousMenuNext("Learn_web_development/Core/Scripting/Return_values","Learn_web_development/Core/Scripting/Event_bubbling", "Learn_web_development/Core/Scripting")}} +{{PreviousMenuNext("Learn_web_development/Core/Scripting/Test_your_skills/Functions","Learn_web_development/Core/Scripting/Event_bubbling", "Learn_web_development/Core/Scripting")}} Events are things that happen in the system you are programming, which the system tells you about so your code can react to them. For example, if the user clicks a button on a webpage, you might want to react to that action by displaying an information box. @@ -395,4 +395,4 @@ In this chapter we've learned what events are, how to listen for events, and how You've seen by now that elements in a web page can be nested inside other elements. For example, in the [Preventing default behavior](#preventing_default_behavior) example, we have some text boxes, placed inside {{htmlelement("div")}} elements, which in turn are placed inside a {{htmlelement("form")}} element. What happens when a click event listener is attached to the `