Lexx,
<body>
<script>
function Test() {
let str = '';
let tags = {
span(tagSpan) {
str += `<span>${getFullName()}</span>`
function getFullName() {
return tagSpan + "!!!";
}
return this;
},
toString() {
return str;
}
};
return tags
};
document.body.append(Test().span('Hello').span('World').toString());
</script> </body>