Ctrl+C
process.exit();
allowOutsideClick: false
<script>
// JavaScript Program to illustrate split() function
function func() {
//Original string
var str = 'Geeks for Geeks'
var array = str.split("for");
document.write(array);
}
func();
</script>
npx create-react-app my-app // npx on the first line is not a typo
cd my-app
npm start
mkdir new-react-app
cd new-react-app
npm init --y
const url = localhost:4000/api/users/register;
const usersData= [];
let getData = () => {
axios.get(url)
.then(res => usersData.push(res.data))
.catch(err => console.log(err.data))
}
const reactData = [{ id: 1, name:' Tom'}, { id: 2, name:' Sarah'}];
const url = localhost:4000/api/users/register;
let sendData = () => {
axios.post(url, reactData)
.then(res => console.log('Data send'))
.catch(err => console.log(err.data))
}
#python route
@app.route('/this-route', methods=['GET', 'POST']):
def thisRoute():
information = request.data
return "1"
#javascript
const URL = '/get-coordinates'
const xhr = new XMLHttpRequest();
sender = JSON.stringify([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
xhr.open('POST', URL);
xhr.send(sender);
function getInputFromTextBox() {
var input = document.getElementById("userInput").value;
alert(input);
}
var values = getValues();
var first = values[0];
var second = values[1];
function getNames() {
// get names from the database or API
let firstName = 'John',
lastName = 'Doe';
// return values
return {
firstName,
lastName
};
}
//function that returns multiple values
function getTopTwoColors() {
return ["blue", "pink"];
}
var topTwoColors=getTopTwoColors();
var firstValue=topTwoColors[0]; //get first return value
var secondValue=topTwoColors[1]; //get second return value
let str = "12345.00";
str = str.slice(0, -1);
console.log(str);
let str = "12345.00";
str = str.substring(0, str.length - 1);
console.log(str);
var str = "Hello TecAdmin!";
var newStr = str.slice(0, -1);
$(this).closest('.parentClassname').remove();