
Plus, it unravels your thinking-through ability. Although this is about building a card game, it exposes you to most of JavaScript's wiring techniques in real-life situations. It's perfect for beginners and refreshers. So it’s faster and also shorter to write. In other words, the result is the same as elem.querySelectorAll (css) 0, but the latter is looking for all elements and picking one, while elem.querySelector just looks for one. The tutorial is stepwise and easy to follow despite the heavy lifting you'll do behind the scene. The call to elem.querySelector (css) returns the first element for the given CSS selector. So while you'll not design the cards yourself, you'll learn to manipulate their positions responsively, increment game rounds, add or remove scores as the levels change, and store game scores in the browser's local storage-all using JavaScript. Each card is an image of four different card roles. The project's end goal is to flip a couple of cards, and the player guesses the Ace when the cards finally switch spots. While the main focus is to teach JavaScript, you'll also learn to combine the designing power of CSS with HTML's DOM structuring to achieve responsiveness with JavaScript. This object contains getter/setter functions to retrieve the paths of some popular web browsers on the operating system in use.This JavaScript card game with Gavin Lon shows you the way around flipping cards with over 600 lines of JavaScript code. The open.apps object provides a cross-platform solution for opening URLs with specific web browsers. Cross-Platform URL Handling With the open.apps Object Here, the value of app.name contains the file path to the FireFox executable. Here’s an example of opening a website in a specific browser: const fireFox = "C:/Program Files (x86)/Mozilla Firefox/firefox.exe" This results in a Windows machine using Microsoft Word to open the text document. In the case above, the winWord variable holds the file path to Microsoft Word, and the name property of the app object in the options object is set to the winWord variable.


To open a file in a specific application, you need to pass the path of that application into the options object.

Here's an example of how to open a text document with Microsoft Word on a Windows machine: const open = require( "open") Ĭonst winWord = "C:/Program Files (x86)/Microsoft Office/Office15/WINWORD.EXE" For example, you can select an application that you want to use to open the file or URL. You can pass an options object to the open() function to specify how to open the file. Specifying Applications to Open Files or URLs
