// var values = [0, 3, 3, 4, 2, 7, 1]
// console.log(values.sort(function (value1, value2){
// return value1 + value2
// }))
// var fn = {}
// fn.name = 'shabi'
// console.log(fn.name)
// var somefn = function() {
// }
// somefn.somewords = 'dashabi'
// console.log(somefn.somewords)
function assert(value, text) {
if(value === true) {
console.log(text)
} else {
console.log('信息有误')
}
}
var store = {
nextID : 1,
cache : {},
ttt: 3,
add : function(fn) {
if (!fn.id) {
fn.id = this.nextID ++
this.cache[fn.id] = fn
return ture
}
}
}
function test() {
console.log('fn test')
}
assert(store.add(test), 'function was safety added')
console