Callback functions – introduce you to the callback functions and learn how to use the callbacks to handle asynchronous operations. Returning multiple values – guide you on how to return multiple values from a function.
Using the map method, we can map our history of moves to React elements representing buttons on the screen, and display a list of buttons to “jump” to past moves. We’ll want the top-level Game component to display a list of past moves. It will need access to the history to do that, so we will place the history state in the top-level Game component. Given an array of 9 squares, this function will check for a winner and return ‘X’, ‘O’, or null as appropriate. You can learn more about shouldComponentUpdate() and how you can build pure components by reading Optimizing Performance. After these changes, we’re again able to click on the Squares to fill them, the same as we had before.
- Set – learn how to use the Set type that holds a collection of unique values.
- It is supported by all major browsers like Chrome, Firefox, Internet Explorer, etc.
- We recommend reading this tutorial, in the sequence listed in the menu.
- If you enjoyed playing, and wish to go further, take advantage of the resources listed below.
The challenges are inspired from modern real world projects to make sure that you’re learning the best practices, one step at a time. Throughout this tutorial, we touched Programming C# 6 Lessons on React concepts including elements, components, props, and state. For a more detailed explanation of each of these topics, check out the rest of the documentation.
- This uses the identity operator to compare the variable iceCream with the string chocolate to see if the two are equal.
- An operator is a mathematical symbol that produces a result based on two values .
This is a curated resource covering the important parts of the whole language. It is being used with IoT and robotics to create smart and intelligent systems. For example, Node JS can be used for programming a flying robot.
- Scotch.io is a blog that provides educational tutorials for programmers of all levels.
- Avoiding direct data mutation lets us keep previous versions of the game’s history intact, and reuse them later.
Learn More About Coding
- You can use ++ and — to increment and decrement respectively.