function some_func_1() {
function inner() {
console.log('hello!');
}
return {inner: inner}
}
some_func_1().inner();
let function_name = 'inner';
some_func_1()[function_name]()
var audio1,audio2;//объекты звуков
function stop_play(){
if(audio1)audio1.stop();//отключаем первый звук если он был
if(audio2)audio2.stop();//отключаем второй звук если он был
audio1=undefined;
audio2=undefined;
}
function play_sound_1(){
stop_play();
audio1 = new Audio ('audio/1.mp3');
audio1.autoplay = true;
}
function play_sound_2(){
stop_play();
audio2 = new Audio ('audio/2.mp3');
audio2.autoplay = true;
}
var polygon = L.polygon([
[51.509, -0.08],
[51.503, -0.06],
[51.51, -0.047]
]).addTo(mymap);
JSON.stringify(polygon.toGeoJSON().geometry.coordinates[0])
"[[-0.08,51.509],[-0.06,51.503],[-0.047,51.51],[-0.08,51.509]]"
var a = [];
mymap.eachLayer(l=>'toGeoJSON' in l && a.push(l.toGeoJSON()));
var result = {"type":"FeatureCollection","features":a};
console.log(JSON.stringify(result,"\n",4))
$.ajax({
...
success: function(data) {
var file=document.createElement('a');
file.href=window.URL.createObjectURL(new Blob([data],{type: "application/pdf"}));
file.download="Report.pdf";
file.click();
}
});
$.ajax({
...
success: function(data) {
chrome.downloads.download({
url : URL.createObjectURL(new Blob([data],{type: "application/pdf"})),
filename : "Report.pdf",
conflictAction : 'uniquify'
});
}
});
[[1,2,3],[4,5,6],[7,8,9]].forEach(
(row,i)=>(
console.log("row = "+i),
row.forEach(
(col,n)=>(
console.log("col = "+n),
console.log(col)
)
)
)
)
var arr = [[1,2,3],[4,5,6],[7,8,9]];
for(let i = 0; i < arr.length ; i++){
for(let n = 0; n < arr[i].length ; n++){
console.log(arr[i][n]);
}
}
button.onclick = () => {
let input = document.querySelector('.u-1').value;
arr1.push(input);
div.innerHTML = arr1;
}
let input = document.querySelector('.u-1');
button.onclick = () => {
arr1.push(input.value);
div.innerHTML = arr1;
}