<!DOCTYPE html>
<html>
<head>
<title>Parcel Sandbox</title>
<meta charset="UTF-8" />
</head>
<body>
<canvas id="app"></canvas>
<script src="src/three.js"></script>
<script src="src/index.js"></script>
</body>
</html>
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 );
const renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );
if(e.target.value === 'amd') { // '=' => '==='
ads.textContent = amd
} else if(e.target.value === 'azn') { // '=' => '==='
ads.textContent = azn
} else {
ads.textContent = usd
}
Должно работать так же как и с
Room.update({_id: room._id, "subDocs._id": user._id}, {$set: { <your_data> });
const puppeteer = require('puppeteer');
const siteURLs = ['http://example0.com', 'http://example1.com', 'http://example2.com'];
function makeScreenshotFromSite(url, page) {
return page.setViewport({width: 1600, height: 1200})
.then(() => {
return page.goto(siteURL,{ waitUntil: 'networkidle2' });
})
.then(() => {
return page.screenshot({path: '__PNG.png', fullPage: true});
});
};
async function start(sites) {
const browser = await puppeteer.launch();
const page = await browser.newPage();
const someRes = await Promise.all(
sites.map(makeScreenshotFromSite)
);
await browser.close();
}
var klick_button = document.getElementById('ras');
klick_button.onclick = function() {
var cel_fun = 0;
var u=[];
var v=[];
var mat=[
[],
[],
];
var rows = document.getElementById("x").value,
columns = document.getElementById("y").value;
for(var i = 0; i < rows; i++){
for(var j = 0; j < columns; j++){
var value_1, value_2;
value_1 = parseInt(document.getElementById('input-' + i + "-" + j).value);
value_2 = parseInt(document.getElementById('input2-' + i + "-" + j).value);
cel_fun = cel_fun + (value_1 * value_2);
n=n+1;
if (value_1 != 0) {
mat[n][0]=u[i];
mat[n][1]=v[j];
mat[n][2]=value_2;
}
}
}
alert(mat[0][2]);
}
const get = timeout => url =>
Promise.race([
fetch(url),
new Promise((resolve, reject) =>
setTimeout(() => reject(new Error('timeout')), timeout)
)
]);
// helpers start
const compose = (fn1, fn2) => x => fn1(fn2(x));
const reduceByProp = prop => a =>
a.reduce((acc, curr) => ({ ...acc, [curr[prop]]: curr }), {});
const uniqByProp = prop => compose(Object.values, reduceByProp(prop));
// helpers end
// logic start
const uniqByLastname = uniqByProp('lastname')
const getUniqAndPrint = compose(console.log, uniqByLastname)
// logic end
// exec start
const arr = [
{
'name': 'anna',
'lastname': 'petrova'
},
{
'name': 'vika',
'lastname': 'ivanova'
},
{
'name': 'julia',
'lastname': 'petrova'
},
];
getUniqAndPrint(arr);
// exec end