Skip to content

Instantly share code, notes, and snippets.

View dg92's full-sized avatar
💭
💻 🔁 😴

Deepak Gupta dg92

💭
💻 🔁 😴
View GitHub Profile
module.exports = [
{
"id": 4,
"title": "At et magnam iusto reiciendis eaque nesciunt.",
"subtitle": "Et aut exercitationem et laborum enim consequatur minima cum quo. Sed accusamus atque veritatis nisi error voluptatibus suscipit. Voluptatum omnis pariatur ducimus. Nisi dolor placeat sunt repellat. Nam ad officia debitis qui non. Quia quo consequatur voluptatibus voluptas molestias.",
"body": "Saepe eum totam ipsum ipsum praesentium porro amet.\nNumquam at et rerum iusto voluptas.",
"published": true,
"author": "Jaclyn White",
"upvotes": 12,
"downvotes": 1,
export default function sketch (p) {
let capture = null;
let cocossdModel = null;
let cocoDrawings = [];
let faceDrawings = [];
function showCocoSSDResults(results) {
| | Short-circuit? | Short-circuits on? | Fulfilled on? | Rejected on? |
|--------------------|:--------------:|------------------------|-------------------------|------------------------|
| Promise.all | ✅ | First rejected promise | All promise fulfilled | First rejected promise |
| Promise.allSettled | ❌ | N/A | Always | N/A |
| Promise.race | ✅ | First settled | First promise fulfilled | First rejected promise |
const customIterable = {
[Symbol.iterator]() {
let counter = 0;
return {
next() {
if (counter < 5) {
counter++;
return { done: false, value: counter };
} else {
return { done: true, value: undefined };
const range = {
start: 1,
end: 5,
[Symbol.iterator]() {
this.current = this.start;
return this;
},
next() {
const users = [
{
id: 1,
name: "Jonathon Haley",
username: "Monte.Weber2",
email: "Daphne43@yahoo.com",
phone: "1-563-675-1857 x11708",
website: "carmela.net",
password: "hashed_password"
},
const user = [
{
id: 1,
naame: "Jonathon Haley",
username: "Monte.Weber2",
email: "Daphne43@yahoo.com",
phone: "1-563-675-1857 x11708",
website: "carmela.net",
password: "hashed_password"
},
// calculate the sum of array elements
const sum = (arr) => arr.reduce((total, item) => total += item, 0);
// to calculate the sum of array elements
const sum = (arr) => {
let result = 0;
for (let i = 0; i < arr.length; i++) {
result += arr[i];
}
return result;
};
import React from 'react'
import {
bool,
number,
object,
string,
} from 'prop-types'
export const ANIMATION_TIME = 200 * 4;