[[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;
}
from dbfread import DBF
table = DBF("ADDROB77.DBF",encoding="cp866")
for row in table:
for i,coll in enumerate(table.field_names):
print("%d %s = %s"%(i,coll,row[coll]))
break#только первая строка для теста
const arr = [
{ model: '001', param1: 'a1', param2: 'a2', paramN: 'aN' },
{ model: '001', param1: 'b1', param2: 'a2', paramN: 'bN' },
{ model: '001', param1: 'a1', param2: 'a2', paramN: 'cN' },
{ model: '002', param1: 'c1', param2: 'b2', paramN: 'dN' }
];
var param1=[],param2=[];
var _arr=arr.filter(function(e){return !param1.includes(e.param1)&&!param2.includes(e.param2)&¶m1.push(e.param1)&¶m2.push(e.param2)});
[
{model: "001", param1: "a1", param2: "a2", paramN: "aN"},
{model: "002", param1: "c1", param2: "b2", paramN: "dN"}
]
>>> sunofdog = "{'d': '19', 'mon': '09', 'month': 'Сентябрь', 'address': 'Г. Кемерово ул. Ноградская д. 16, кв. 1'}"
>>> a = json.loads(sunofdog.replace("'",'"'))
>>> type(a)
"<class 'dict'>"
>>> b = eval(sunofdog)
>>> type(b)
"<class 'dict'>"
>>> a
{'d': '19', 'mon': '09', 'month': 'Сентябрь', 'address': 'Г. Кемерово ул. Ноградская д. 16, кв. 1'}
>>> a == b
True
>>>
>>> import ast
>>> c = ast.literal_eval(sunofdog)
>>> a == c
True
>>>
var d = (new Date())-(new Date(2019,8,19));
Math.floor(130/60)
130%60
let a = new Date(2019,8,19,0,0,0).valueOf();//1568836800000
let b = new Date(2019,8,19,1,23,45,678).valueOf();//1568841825678
let c = Math.abs(a-b);//5025678
let millis = c%1000;//678
c=Math.floor(c/1000);//5025
let secs = c%60;//45
c=Math.floor(c/60);//83
let mins = c%60;//23
c=Math.floor(c/60);//1
let hours=c%24;//1
c=Math.floor(c/24);//0
let days = c;//0
new Date((new Date(2019,8,19,1,23,45,678))-(new Date(2019,8,19,0,0,0))).toJSON().split("T")[1]
"01:23:45.678Z"