随笔分类 - Programming
摘要:JavaScript 1. splice let arr = [1, 2, 3, 5, 6, 4, 3, 2, 1, 1, 2, 3, 4, 5] for(let i = 0; i < arr.length - 1; ++i) { for(let j = i + 1; j < arr.length;
阅读全文
摘要:JavaScript let arr = [8, 4, 3, 2, 6, 7, 1, 5, 9] function quickSort(arr) { console.log(arr) if(arr.length <= 1) return arr let midIndex = parseInt(arr
阅读全文
摘要:while initialize test change operation change, test, operation's order will affect the first line number
阅读全文
摘要:find out diagonal for(let b = 1; b <= 9; ++b) { let res = '' for(let p = 1; p <= 9; ++p) { if(b > p) res += ' ' else res += '*' } console.log(res) } f
阅读全文
摘要:Java can't return value Python can only return None JavaScript can return any value
阅读全文
摘要:Java arr本质是一个数组,可直接传数组,引用类型,可能为null JavaScript Function length rest parameter Go
阅读全文
摘要:C Java == 基本数据类型时, two operands类型不同时, 必须可以进行自动类型转换, e.g. byte & char => int, 不能进行自动类型转换(boolean & char)则编译失败, == 不能比较基本类型和引用类型, 基本数据类型只有boolean不能与其他7个
阅读全文
摘要:C goto Must be defined within a function Each label in one function must have a unique name. It cannot be a reserved C keyword C has a separate namesp
阅读全文
摘要:In Java, C, $ is valid In Go, Python, $ is invalid
阅读全文
摘要:Go C Java https://introcs.cs.princeton.edu/java/11precedence/ Python
阅读全文