This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| router.post('/endpointname', async function (req, res, next) { | |
| let bodyObj = { "x": {} }; | |
| let requestURL = "https://reqres.in/api/register"; | |
| let requestOptions = { | |
| method: "POST", | |
| body: JSON.stringify(bodyObj), | |
| headers: { 'Content-Type': 'application/json' } | |
| }; | |
| try { | |
| const urlResponse = await fetch(requestURL, requestOptions); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| router.post('/endpointname', async function (req, res, next) { | |
| let bodyObj = { "x": {} }; | |
| let requestURL = "https://reqres.in/api/register"; | |
| let requestOptions = { | |
| method: "POST", | |
| body: JSON.stringify(bodyObj), | |
| headers: { 'Content-Type': 'application/json' } | |
| }; | |
| try { | |
| const apiResponse = await fetch(requestURL, requestOptions); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const pdcObject = pdcs_collection.find((pObj) => pObj.itemId == p.itemId); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const arr = [ | |
| { | |
| "Company": "IBM" | |
| }, | |
| { | |
| "Person": "ACORD LOMA" | |
| }, | |
| { | |
| "Company": "IBM" | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // An array of objects | |
| var persons = [{name: "Harry"}, {name: "Alice"}, {name: "Peter"}]; | |
| // Find if the array contains an object by comparing the property value | |
| if(persons.some(person => person.name === "Peter")){ | |
| alert("Object found inside the array."); | |
| } else{ | |
| alert("Object not found."); | |
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder