Jon Rumsey

An online markdown blog and knowledge repository.


Project maintained by nojronatron Hosted on GitHub Pages — Theme by mattgraham

Breaking Down Code Problems

Presenter: Monika Davies

Topic: Breaking down problems in javascript

This is an important web development skill.

Demo app will be to build Rock-paper-scissors, an HTML, CSS, and JavaScript single-page app.

Necessary Steps To Get Started

Get requirements:

Consider UI Structure:

Consider Styling:

Consider Functionality and Dynamic Aspects:

Consider Artifacts:

Other Tidbits

Input type elements aren't that much different than Button elements, and can be set written to handle events like a button would.

Use ID's to enable elements that can display data and have it get dynamically updated e.g. Player Score.

Find all items with class name 'class' and store them in a variable: const buttons = document.querySelectAll('.class')

Add an event listener with button.addEventListener('click', handlerFunction)

Use Console.Log to verify event listeners are working.

Need to select an item randomly from a string array? Use Random, but put its bounds between 0 and max index of the array, then use array indexing to get the item from the array with the random index number.

Is there a large matrix of possible outcomes:

Back to PPH Index

Return to Root README