1// -------// -------// -------
2// index.js
3// -------// -------// -------
4
5const user = {
6 name: "zidane",
7 email: 'huuvi168@gmail.com'
8};
9
10const element = <h1> {user.name} exist email: {user.email} </h1>;
11
12const element2 =
13 <div className="heading">
14 <h1> {user.name} </h1>
15 <h1> {user.email} </h1>
16 </div>;
17
18var numbers = [1,2,3,4];
19var doubleNumbers = numbers.map(function(num){
20 return num * 2 + "; ";
21})
22
23var doubleNumberArrowFunction = numbers.map((num) => num * 3 + "; ");
24
25var element3 =
26 <div>
27 Double numbers: {doubleNumberArrowFunction}
28 </div>;
29
30ReactDOM.render(
31 element3,
32 // <React.StrictMode>
33 // <App />
34 // </React.StrictMode>,
35 document.getElementById('root')
36);
37
38// -------// -------// -------
39// ------- index.css ------
40// -------// -------// -------
41.heading {
42 padding: 10px;
43 color: white;
44 background-color: green;
45}