reactjs basic example
// -------// -------// -------
// index.js
// -------// -------// -------
const user = {
name: "zidane",
email: '[email protected]'
};
const element = <h1> {user.name} exist email: {user.email} </h1>;
const element2 =
<div className="heading">
<h1> {user.name} </h1>
<h1> {user.email} </h1>
</div>;
var numbers = [1,2,3,4];
var doubleNumbers = numbers.map(function(num){
return num * 2 + "; ";
})
var doubleNumberArrowFunction = numbers.map((num) => num * 3 + "; ");
var element3 =
<div>
Double numbers: {doubleNumberArrowFunction}
</div>;
ReactDOM.render(
element3,
// <React.StrictMode>
// <App />
// </React.StrictMode>,
document.getElementById('root')
);
// -------// -------// -------
// ------- index.css ------
// -------// -------// -------
.heading {
padding: 10px;
color: white;
background-color: green;
}
Also in JavaScript:
- event loop in javascript
- js test if array
- identify chrome on android using javascript
- node import all functions from file
- jQuery Event Methods
- random hexadecimal character js
- react detect cursor
- loading page for all ajax call in jquery 3.3.1
- hackerrank fizzbuzz javascript
- javascript array spiral
- change value rateit.js using jquery
- codeigniter raw query
- append data in value array javascript
- replace multiple spaces with single space javascript
- javascript loop through array backwords
- integer to array javascript
- how to render react native app under the status bar
- comment faire pour écrire un texte en javascript
- javascript how-do-i-check-whether-a-checkbox-is-checked-in-jquery
- discord js channel connect
- component unmount useeffect
- jquery get value of radio input
- vuejs filter array by dates
- js opposite of includes