You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// the templates are the same at first
let firstTemplate = '---\nfield: ["original value"]\n---\ncontent';
let secondTemplate = '---\nfield: ["original value"]\n---\ncontent';
for (let i = 0; i < 2; i++) {
firstTemplate = updateFrontMatter(firstTemplate, "field", `new value for firstTemplate ${i}`, true);
console.log("firstTemplate \n", firstTemplate);
}
secondTemplate = updateFrontMatter(secondTemplate, "field", "new value for secondTemplate", true);
console.log("secondTemplate", secondTemplate);
LOG:
firstTemplate
---
field:
- original value
- new value for firstTemplate 0
---
content
firstTemplate
---
field:
- original value
- new value for firstTemplate 0
- new value for firstTemplate 1
---
content
secondTemplate ---
field:
- original value
- new value for firstTemplate 0
- new value for secondTemplate
---
content
Can anyone explain for me why at 2nd template value it has value from the 1st one? The line matterValue from const matterValue = matter(template); always return a new ref right?
The text was updated successfully, but these errors were encountered:
LOG:
Can anyone explain for me why at 2nd template value it has value from the 1st one? The line matterValue from
const matterValue = matter(template);
always return a new ref right?The text was updated successfully, but these errors were encountered: