Skip to content

yjgaia/KavaScript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

KavaScript

KavaScript is superset of JavaScript.

Multi-line Text

JavaScript

var multiline = 'This\nis\nmulti-line\ntext.';

KavaScript

var multiline = 'This
is
multi-line
text.';

Callback Hell

JavaScript

get(function(data) {

	find({
		name : data.name
	}, function(result) {
		
		update({
			name : 'John'
		}, function(result) {
			...
		});
	});
    
    find({
		age : data.age
	}, function(result) {
		...
	});
});

KavaScript

var data = get(<-);

var result = find({
    name : data.name
}, <-);

update({
	name : 'John'
}, <-);
...
---
---

result = find({
    age : data.age
}, <-);
...
---

OOP

JavaScript

prototype based oop.

KavaScript

var Animal = class() {

	pub bark = (sound) {
		alert(sound);
	};
};

var Man = class(firstName, lastName, age) extend Animal() {
	
	// private
	var name = firstName + ' ' + lastName;
    
    // protected
    pro introduce = () {
    	console.log('My name is ${name}, I\'m ${age} years old.');
    };
    
    // public
    pub talk = (message) {
    	bark(message);
    }
};

var John = class() extend Man('John', 'Smith', 24) {

	// my name is John Smith, I'm 24 years old.
	introduce();
};

var john = new John();
john.talk('Hello, I\'m John!');

function

var f = function(a, b, c) {
	...
};
var f = (a, b, c) {
	...
};

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published