How to use class in React

PHOTO EMBED

Thu Jul 11 2024 19:07:48 GMT+0000 (Coordinated Universal Time)

Saved by @Black_Shadow #react.js #javascript #html

<!DOCTYPE html>
<html>
​
<body>
  
<script>
class Car {
  constructor(name) {
    this.brand = name;
  }
}
​
const mycar = new Car("Ford");
​
document.write(mycar.brand);
</script>
​
</body>
</html>
​
content_copyCOPY

This is javascript code that can use it with react

https://www.w3schools.com/react/tryit.asp?filename