-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
20 lines (13 loc) · 734 Bytes
/
main.js
File metadata and controls
20 lines (13 loc) · 734 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
var stringBuffer=require('./src/util/StringBuffer');
var strBuff =new stringBuffer();
strBuff.append("hello String");
strBuff.append("when we append no strings are created, only buffer appended in memory");
strBuff.append(332); //Numbers too. append them as string
strBuff.append(true); //Boolean append as string, "true" or "false"
strBuff.append({dd:34, hh:"hello"}); //Objects will be append as JSON strings of them.
//Print
console.log(strBuff.toString()); // toString() will get us the buffer as string.
var stb=new stringBuffer();
stb.append("hello String");
stb.append("when we append no strings are created, only buffer appended in memory");
console.log(stb.toString()); // toString() will get us the buffer as string.