scrimba
21 web dev tips for 2021 🎇
Tip 9: Creating Polyfill
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

AboutCommentsNotes
Tip 9: Creating Polyfill
Expand for more info
components
PriceDisplay.js
run
preview
console
// Creating Helpers

import React from 'react'
import ReactDOM from 'react-dom'
import helpers from '../lib/helpers'

const PriceDisplay = () => {
const price = 123.4556
const secondPrice = 3452.445

const prices = [price, secondPrice]

return (
<>
<div className="price-rounder-container">
<h2>Last Transaction</h2>
<div className="price-display">£{helpers.normalisePrice(price)}</div>
</div>
<h2>£{helpers.getTotal(prices)}</h2>
</>
)
}

export default PriceDisplay

// Mini Challenge
// In the same way that we created this helper, Can you add a helpers that will help us display the // total price of all 3 the previous transactions in the App Component and the total price of the // prices in the Price Display Component?
Console
/index.html
-4:46