React Class vs Functional Components: A Complete Comparison

Class component import React from "react"; class Counter extends React.Component { constructor(props) { super(props); this.state = { count: 0 }; this.handleIncrement = this.handleIncrement.bind(this); this.handleDecrement = this.handleDecrement.bind(this); } componentDidMount() { this.setState({ count: this.state.count + 1 }); } handleIncrement() { this.setState({ count: this.state.count + 1 }); } handleDecrement() { this.setState({ count: this.state.count - 1 }); } render() … Continue reading React Class vs Functional Components: A Complete Comparison

Useful Javascript Info everyone should know

Template literals ES6 introduced template literals which are similar to strings only surrounded with backticks instead of quotes. They allow embedded expressions within. Use ${} to interpolate expressions or values into a string. const name = 'Jonathan'; const greeting = `Hello ${name}`; const dontDoThis = 'Hello' + ' ' + name; console.log(greeting); > Hello Jonathan … Continue reading Useful Javascript Info everyone should know