Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var examplevar = "doorknobs";
- document.write(giveString()); // use () after the call as it's a function and not a variable (var)
- document.write(examplevar); // no () needed as it's a variable
- document.write(mergeStrings("lel", " you suck"));
- var lel = mergeStrings("lel", "you suck");
- document.write(lel); // same as prev. document.write
- printString(lel); // same as above
- printPredefinedString(); // it calls document.write itself
- document.write(printPredefinedStringAndGiveMeSomethingBack()); //prints itself AND as it returns something document.write prints something valid as well
- function giveString() { // giving predefined string
- return "pleb";
- }
- function mergeStrings(var a, var b) {
- return a + b;
- }
- function printString(var a) {
- document.write(a);
- }
- function printPredefinedString() {
- document.write("yolo");
- }
- function printPredefinedStringAndGiveMeSomethingBack() { // as if I can come up with something better
- document.write("yolo");
- return "swag";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement