JSFiddle - React, Tailwind, and code Playground

by Ravindra Athreya

HTML

<div class="test">
Test
</div>
<div class="hid">
Test
</div>
<div>
Test3
</div>

CSS

.test {
  color : red
}

.hid {
  /* visibility: hidden; */
  display: none
}

.test {
  color: green
}

JavaScript

const arr = [];
arr.push("1", "2", "3");
arr.unshift("Pear")
console.log(arr)

const data = {
 title: 'foo',
    body: 'bar',
    userId: 1
}

fetch('https://jsonplaceholder.typicode.com/posts', {
method: 'POST',
headers: {
'Content-type': 'application/json; charset=UTF-8'
},
body: JSON.stringify(data)
})
.then((response) => response.json())
.then((json) => console.log(json))

const data1 = [ [{id:1}, {id:2}], [{id:3}] ];
const result = data1.flat();
console.log(result);