SlideShare a Scribd company logo
1 of 10
© Anselm Spoerri
Web Programming Course
Web Programming
Info + Web Tech Course
Anselm Spoerri PhD (MIT)
SC&I @ Rutgers University
aspoerri@rutgers.edu
© Anselm Spoerri
Web Programming Course
Lecture 7 - Overview
Ex2 Revision Due Mar 12
Ex2 Walkthrough Screencast
Make sure all expected inputs provided to Geocoding function
Ex3 Lab Due Mar 5
React.js
What to Do BEFORE Next Class
‒ React.js videos in Week 8 (in green)
© Anselm Spoerri
Web Programming Course
Recap – Ex3 Lab – Bootstrap 4
Create Responsive Grid Layout col-SIZE-SPAN
bootstrap_grid_basic | grid_examples | v3 templates
xl row1: 1 column
row2: 2 unequal columns (10 + 2)
and 1st large column contains 2 equal columns
row3: 6 equal columns
row4: 4 equal columns
lg row1: 1 column
row2: 2 unequal columns (9 + 3)
and 1st large column contains 2 equal columns
row3: 3 equal columns
row4: 2 equal columns
md row1: 1 column
row2: 2 unequal columns (8 + 4)
and 1st large column contains 1 column
row3: 2 equal columns
row4: 1 column
sm all linear = “no columns”
© Anselm Spoerri
Web Programming Course
Ex3 Lab – Bootstrap 4
Create Responsive Grid Layout col-SIZE-SPAN
Learn from: w3Schools Band Page v3
bootstrap_theme_band | bootstrap/tryit
Create Collapsible Navigation with Dropdown
Navigation bootstrap_navbar |
Dropdowns bootstrap_dropdowns
Collapse bootstrap_collapse
Create Slideshow images to use
Carousel bootstrap_carousel
.carousel-inner img { width: 100%; height: 100%;}
Add Cards and Circle Images images to use
Cards bootstrap_cards
Images bootstrap_images | class="img-fluid"
Add Toggleable / Dynamic Tabs Tabs nav_with_tabs
Add Table Table bootstrap_tables
Link Collapsible Content to Images
Collapse bootstrap_collapse
© Anselm Spoerri
Web Programming Course
React.js
Create large-scale single page application and interactive UIs
Design simple views for each state in application  React efficiently updates and
renders just the right components when data changes.
Virtual DOM: efficiently update & render just right components when data changes
v16: complete rewrite
• Improved asynchronous rendering
• Arrays of elements can be returned
• Better error handling
• Smaller file size
• Large performance improvement
© Anselm Spoerri
Web Programming Course
React.js – Getting Ready
Install React developer tools as Chrome extensions
https://chrome.google.com/webstore/search/react%20developer%20tools
https://github.com/facebook/react-devtools/blob/master/README.md#the-react-tab-doesnt-show-up
Install ATOM packages
https://atom.io/packages/react
Add React.js CDN files to web page (v17) https://reactjs.org/docs/cdn-links.html
ReactDOM.render( element, container, [callback] )
React.createElement( type, [props], [...children] )
JSX, or JavaScript as XML – write HTML tags inside JavaScript introducing-jsx
If a tag is empty, you may close it immediately with />, like XML
React DOM uses camelCase property naming convention
class becomes className in JSX, and tabindex becomes tabIndex.
Any JavaScript expression within curly braces { … } inside JSX
Babel.js – transpile or preprocess JSX using Babel try it : https://babeljs.io/repl/
Code written with JSX will be converted to use React.createElement().
You will not typically invoke React.createElement() directly if you are using JSX.
Add Babel.js CDN file to web page and <script type="text/babel">
https://atom.io/packages/language-babel
© Anselm Spoerri
Web Programming Course
React.js – Components
React = Collection of Components = UI elements with changing data
ES6 Class Component
class MyComp extends React.Component { render () { HTML }}
ReactDOM.render(<MyComp />, where in DOM))
Always start component names with a capital letter
<div /> represents a DOM tag, but <MyComp /> represents component
and requires MyComp to be in scope.
CSS classes: need use className inside of component creation
Stateless Component
const MyComp = () => <h1>Hello World</h1>
Properties
Class component: this.props contains props defined by caller of this component
{this.props.text} inside JSX <MyComp text="Hello World"/>
{this.props.children} inside JSX <MyComp text="Hi">World</myComp>
Stateless component: const MyComponent = (props) => <h1>{props.text}</h1>
ES6 destructuring = unpack array values / object properties into distinct variables
const MyComponent = ({text}) => <h1>{props.text}</h1>
© Anselm Spoerri
Web Programming Course
React.js – Functions and State and Refs
Add functions to Components to handle events
Note extends React.Component { edit() {alert("Editing Note")},
render() {… <button onClick={this.edit}>EDIT</button> … }
Define state that can be queried and changed
constructor(props) {
super(props) // access this.props in constructor
this.state = { checked: false } // define state checked
this.handleCheck = this.handleCheck.bind(this) // keep this in scope
}
handleCheck () { this.setState({ checked: !this.state.checked })}
Note: if we want to use this.props inside of return () then need to work using vars
Inside render define var msg and then use if / then / else to reflect this.state.checked
Refs and ref="value"
<textarea ref="newText"></textarea>
var val = this.refs.newText.value
© Anselm Spoerri
Web Programming Course
map function and arrow (=>) function
array.map()
creates new array with results of calling function for every array element
https://www.w3schools.com/jsref/jsref_map.asp
arrow function
shorter syntax than a function expression and does not bind its own this,
arguments, super, or new.target.
https://www.linkedin.com/learning/learning-ecmascript-6/Arrow-functions
var materials = [ 'Hydrogen', 'Helium', 'Lithium', 'Beryllium' ];
var materialsLength1 = materials.map(function(material) {
return material.length; });
var materialsLength2 = materials.map((material) => {
return material.length; });
var materialsLength3 = materials.map(material => material.length);
© Anselm Spoerri
Web Programming Course
React.js – Create React App using Node.js
Node.js https://en.wikipedia.org/wiki/Node.js
Create Fast Web Server using JS and modules
NodeJS Runtime Chrome
Server JavaScript
Event-driven programming using callbacks
Asynchronous events
Non-blocking I/O
Create React app with no build configurations
Open Command Prompt
npm –v
Install npm from https://nodejs.org/en/
Previously in 2021 and will not use in 2022: npm install -g create-react-app
Make sure in ex4 folder inside of terminal
npx create-react-app bulletin-board
cd into the bulletin-board folder
npm start
Ctrl C to stop

More Related Content

Similar to Lec7Handout.ppt

OttawaJS - React
OttawaJS - ReactOttawaJS - React
OttawaJS - Reactrbl002
 
Combining Angular and React Together
Combining Angular and React TogetherCombining Angular and React Together
Combining Angular and React TogetherSebastian Pederiva
 
reactjs-quiz..docs.pdf
reactjs-quiz..docs.pdfreactjs-quiz..docs.pdf
reactjs-quiz..docs.pdfAyanSarkar78
 
A full introductory guide to React
A full introductory guide to ReactA full introductory guide to React
A full introductory guide to ReactJean Carlo Emer
 
React Hooks Best Practices in 2022.pptx
React Hooks Best Practices in 2022.pptxReact Hooks Best Practices in 2022.pptx
React Hooks Best Practices in 2022.pptxBOSC Tech Labs
 
Pluginkla2019 - React Presentation
Pluginkla2019 - React PresentationPluginkla2019 - React Presentation
Pluginkla2019 - React PresentationAngela Lehru
 
react-slides.pdf gives information about react library
react-slides.pdf gives information about react libraryreact-slides.pdf gives information about react library
react-slides.pdf gives information about react libraryjanet736113
 
Adding a modern twist to legacy web applications
Adding a modern twist to legacy web applicationsAdding a modern twist to legacy web applications
Adding a modern twist to legacy web applicationsJeff Durta
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners Varun Raj
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]GDSC UofT Mississauga
 

Similar to Lec7Handout.ppt (20)

OttawaJS - React
OttawaJS - ReactOttawaJS - React
OttawaJS - React
 
Combining Angular and React Together
Combining Angular and React TogetherCombining Angular and React Together
Combining Angular and React Together
 
react-slides.pptx
react-slides.pptxreact-slides.pptx
react-slides.pptx
 
reactjs-quiz..docs.pdf
reactjs-quiz..docs.pdfreactjs-quiz..docs.pdf
reactjs-quiz..docs.pdf
 
ReactJS
ReactJSReactJS
ReactJS
 
ReactJS (1)
ReactJS (1)ReactJS (1)
ReactJS (1)
 
A full introductory guide to React
A full introductory guide to ReactA full introductory guide to React
A full introductory guide to React
 
Let's react - Meetup
Let's react - MeetupLet's react - Meetup
Let's react - Meetup
 
React Hooks Best Practices in 2022.pptx
React Hooks Best Practices in 2022.pptxReact Hooks Best Practices in 2022.pptx
React Hooks Best Practices in 2022.pptx
 
React js
React jsReact js
React js
 
Pluginkla2019 - React Presentation
Pluginkla2019 - React PresentationPluginkla2019 - React Presentation
Pluginkla2019 - React Presentation
 
react-slides.pdf
react-slides.pdfreact-slides.pdf
react-slides.pdf
 
react-slides.pdf gives information about react library
react-slides.pdf gives information about react libraryreact-slides.pdf gives information about react library
react-slides.pdf gives information about react library
 
The Road To Redux
The Road To ReduxThe Road To Redux
The Road To Redux
 
Intro react js
Intro react jsIntro react js
Intro react js
 
ReactJS.pptx
ReactJS.pptxReactJS.pptx
ReactJS.pptx
 
Adding a modern twist to legacy web applications
Adding a modern twist to legacy web applicationsAdding a modern twist to legacy web applications
Adding a modern twist to legacy web applications
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners
 
React/Redux
React/ReduxReact/Redux
React/Redux
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]
 

Recently uploaded

What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 

Recently uploaded (20)

What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 

Lec7Handout.ppt

  • 1. © Anselm Spoerri Web Programming Course Web Programming Info + Web Tech Course Anselm Spoerri PhD (MIT) SC&I @ Rutgers University aspoerri@rutgers.edu
  • 2. © Anselm Spoerri Web Programming Course Lecture 7 - Overview Ex2 Revision Due Mar 12 Ex2 Walkthrough Screencast Make sure all expected inputs provided to Geocoding function Ex3 Lab Due Mar 5 React.js What to Do BEFORE Next Class ‒ React.js videos in Week 8 (in green)
  • 3. © Anselm Spoerri Web Programming Course Recap – Ex3 Lab – Bootstrap 4 Create Responsive Grid Layout col-SIZE-SPAN bootstrap_grid_basic | grid_examples | v3 templates xl row1: 1 column row2: 2 unequal columns (10 + 2) and 1st large column contains 2 equal columns row3: 6 equal columns row4: 4 equal columns lg row1: 1 column row2: 2 unequal columns (9 + 3) and 1st large column contains 2 equal columns row3: 3 equal columns row4: 2 equal columns md row1: 1 column row2: 2 unequal columns (8 + 4) and 1st large column contains 1 column row3: 2 equal columns row4: 1 column sm all linear = “no columns”
  • 4. © Anselm Spoerri Web Programming Course Ex3 Lab – Bootstrap 4 Create Responsive Grid Layout col-SIZE-SPAN Learn from: w3Schools Band Page v3 bootstrap_theme_band | bootstrap/tryit Create Collapsible Navigation with Dropdown Navigation bootstrap_navbar | Dropdowns bootstrap_dropdowns Collapse bootstrap_collapse Create Slideshow images to use Carousel bootstrap_carousel .carousel-inner img { width: 100%; height: 100%;} Add Cards and Circle Images images to use Cards bootstrap_cards Images bootstrap_images | class="img-fluid" Add Toggleable / Dynamic Tabs Tabs nav_with_tabs Add Table Table bootstrap_tables Link Collapsible Content to Images Collapse bootstrap_collapse
  • 5. © Anselm Spoerri Web Programming Course React.js Create large-scale single page application and interactive UIs Design simple views for each state in application  React efficiently updates and renders just the right components when data changes. Virtual DOM: efficiently update & render just right components when data changes v16: complete rewrite • Improved asynchronous rendering • Arrays of elements can be returned • Better error handling • Smaller file size • Large performance improvement
  • 6. © Anselm Spoerri Web Programming Course React.js – Getting Ready Install React developer tools as Chrome extensions https://chrome.google.com/webstore/search/react%20developer%20tools https://github.com/facebook/react-devtools/blob/master/README.md#the-react-tab-doesnt-show-up Install ATOM packages https://atom.io/packages/react Add React.js CDN files to web page (v17) https://reactjs.org/docs/cdn-links.html ReactDOM.render( element, container, [callback] ) React.createElement( type, [props], [...children] ) JSX, or JavaScript as XML – write HTML tags inside JavaScript introducing-jsx If a tag is empty, you may close it immediately with />, like XML React DOM uses camelCase property naming convention class becomes className in JSX, and tabindex becomes tabIndex. Any JavaScript expression within curly braces { … } inside JSX Babel.js – transpile or preprocess JSX using Babel try it : https://babeljs.io/repl/ Code written with JSX will be converted to use React.createElement(). You will not typically invoke React.createElement() directly if you are using JSX. Add Babel.js CDN file to web page and <script type="text/babel"> https://atom.io/packages/language-babel
  • 7. © Anselm Spoerri Web Programming Course React.js – Components React = Collection of Components = UI elements with changing data ES6 Class Component class MyComp extends React.Component { render () { HTML }} ReactDOM.render(<MyComp />, where in DOM)) Always start component names with a capital letter <div /> represents a DOM tag, but <MyComp /> represents component and requires MyComp to be in scope. CSS classes: need use className inside of component creation Stateless Component const MyComp = () => <h1>Hello World</h1> Properties Class component: this.props contains props defined by caller of this component {this.props.text} inside JSX <MyComp text="Hello World"/> {this.props.children} inside JSX <MyComp text="Hi">World</myComp> Stateless component: const MyComponent = (props) => <h1>{props.text}</h1> ES6 destructuring = unpack array values / object properties into distinct variables const MyComponent = ({text}) => <h1>{props.text}</h1>
  • 8. © Anselm Spoerri Web Programming Course React.js – Functions and State and Refs Add functions to Components to handle events Note extends React.Component { edit() {alert("Editing Note")}, render() {… <button onClick={this.edit}>EDIT</button> … } Define state that can be queried and changed constructor(props) { super(props) // access this.props in constructor this.state = { checked: false } // define state checked this.handleCheck = this.handleCheck.bind(this) // keep this in scope } handleCheck () { this.setState({ checked: !this.state.checked })} Note: if we want to use this.props inside of return () then need to work using vars Inside render define var msg and then use if / then / else to reflect this.state.checked Refs and ref="value" <textarea ref="newText"></textarea> var val = this.refs.newText.value
  • 9. © Anselm Spoerri Web Programming Course map function and arrow (=>) function array.map() creates new array with results of calling function for every array element https://www.w3schools.com/jsref/jsref_map.asp arrow function shorter syntax than a function expression and does not bind its own this, arguments, super, or new.target. https://www.linkedin.com/learning/learning-ecmascript-6/Arrow-functions var materials = [ 'Hydrogen', 'Helium', 'Lithium', 'Beryllium' ]; var materialsLength1 = materials.map(function(material) { return material.length; }); var materialsLength2 = materials.map((material) => { return material.length; }); var materialsLength3 = materials.map(material => material.length);
  • 10. © Anselm Spoerri Web Programming Course React.js – Create React App using Node.js Node.js https://en.wikipedia.org/wiki/Node.js Create Fast Web Server using JS and modules NodeJS Runtime Chrome Server JavaScript Event-driven programming using callbacks Asynchronous events Non-blocking I/O Create React app with no build configurations Open Command Prompt npm –v Install npm from https://nodejs.org/en/ Previously in 2021 and will not use in 2022: npm install -g create-react-app Make sure in ex4 folder inside of terminal npx create-react-app bulletin-board cd into the bulletin-board folder npm start Ctrl C to stop