SPA kodetime

This commit is contained in:
Geir Okkenhaug Jerstad 2024-09-24 10:23:25 +02:00
parent b0523a9210
commit 6b3922eddc
4 changed files with 48 additions and 0 deletions

View file

View file

@ -0,0 +1,31 @@
const model = {
app: {
page: 'search'
},
inputs : {
search: {
text: '',
},
createNew: {
name: '',
email: '',
},
delete: {
areYouSure: false,
personId: null,
},
edit: {
personId: null,
name: '',
email: '',
},
},
// felles data
people: [
{ id: 1, name: 'Per', email: 'per@mail.com'},
],
}

View file

@ -0,0 +1,2 @@
const SCRIPTS = require("./scripts.js");

View file

@ -15,3 +15,18 @@ for (let key in arrays) newArray = newArray.concat(arrays[key]);
// }
//reduceArrays();
console.log(newArray2);
function loop(value, testFunc, updateFunc, bodyFunc){
for (let i = 0; i < value; i++){
if (testFunc == false){
return
} else {
// updateFunc(value)
bodyFunc(value);
}
value--;
}
}
loop(3, n => n > 0, n => n - 1, console.log);