Skip to content

Instantly share code, notes, and snippets.

@KonstKh
Created June 15, 2020 16:35
Show Gist options
  • Save KonstKh/dfee2121ed2e9c4e325e03984d8cc4ac to your computer and use it in GitHub Desktop.
Save KonstKh/dfee2121ed2e9c4e325e03984d8cc4ac to your computer and use it in GitHub Desktop.
JS Bin [create list of Month's automatically] // source https://jsbin.com/wedubal
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[create list of Month's automatically]">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
create list of Month's automatically
<script id="jsbin-javascript">
let start = 0;
const minLength = 12;
const maxLength = 180;
const values = Array.from(Array(maxLength/minLength), () => start += 12);
const financeTerms = [];
values.forEach(val => {
// financeTerms[val] = `${val} Monate`
financeTerms.push({[val]: `${val} Monate`})
})
financeTerms.map(term =>
console.log(Object.entries(term)[0][1])
)
// for (let [key, value] of Object.entries(financeTerms)) {
// console.log(`${key}: ${value}`);
// }
</script>
<script id="jsbin-source-javascript" type="text/javascript">let start = 0;
const minLength = 12;
const maxLength = 180;
const values = Array.from(Array(maxLength/minLength), () => start += 12);
const financeTerms = [];
values.forEach(val => {
// financeTerms[val] = `${val} Monate`
financeTerms.push({[val]: `${val} Monate`})
})
financeTerms.map(term =>
console.log(Object.entries(term)[0][1])
)
// for (let [key, value] of Object.entries(financeTerms)) {
// console.log(`${key}: ${value}`);
// }
</script></body>
</html>
let start = 0;
const minLength = 12;
const maxLength = 180;
const values = Array.from(Array(maxLength/minLength), () => start += 12);
const financeTerms = [];
values.forEach(val => {
// financeTerms[val] = `${val} Monate`
financeTerms.push({[val]: `${val} Monate`})
})
financeTerms.map(term =>
console.log(Object.entries(term)[0][1])
)
// for (let [key, value] of Object.entries(financeTerms)) {
// console.log(`${key}: ${value}`);
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment