上一页 1 ··· 175 176 177 178 179 180 181 182 183 ··· 494 下一页
摘要: fun main() { val mode = 3 when (mode) { 1 -> print("1 is ok") 2 -> { print("2 is fine") print("2 is fine") } else -> { print("large than 2 is not ok") 阅读全文
posted @ 2020-10-11 02:07 Zhentiw 阅读(64) 评论(0) 推荐(0)
摘要: In Kotlin, it helps to avoid null reference, which means by default you cannot assign null value to any variable; But if you do want to assign null to 阅读全文
posted @ 2020-10-11 01:56 Zhentiw 阅读(115) 评论(0) 推荐(0)
摘要: fun main() { val a = 4 val b: Byte = 127 val c: Short = 123 val d: Int = 7 val e: Long = 123456789 val f: Float = 3.73f val g: Double = 3.73 val h: Ch 阅读全文
posted @ 2020-10-11 01:48 Zhentiw 阅读(79) 评论(0) 推荐(0)
摘要: using 'var', variable can be reassigned. using 'val', variable cannot be ressiagned. the same as Javascript 'const'. 阅读全文
posted @ 2020-10-11 01:32 Zhentiw 阅读(87) 评论(0) 推荐(0)
摘要: Sometime when you create a library, you want types create automatcially for you, instead of typing all the types information by yourself. // tsconfig. 阅读全文
posted @ 2020-10-09 01:24 Zhentiw 阅读(160) 评论(0) 推荐(0)
摘要: In lodash, you can use 'mixin' to create a new function on lodash object. import * as _ from 'lodash'; _.chunk([1, 2, 3, 4], 2); // [[1,2], [3,4]] _.m 阅读全文
posted @ 2020-10-09 01:19 Zhentiw 阅读(94) 评论(0) 推荐(0)
摘要: Instead of first checking to see if a record already exists within your table, we can do a on conflict do update. In this command, we can ether insert 阅读全文
posted @ 2020-10-08 02:25 Zhentiw 阅读(190) 评论(0) 推荐(0)
摘要: The useDebugValue hook will not effect your user experience but is instead aimed at improving the developer experience. When building your own custom 阅读全文
posted @ 2020-10-08 02:19 Zhentiw 阅读(138) 评论(0) 推荐(0)
摘要: function reverse(str: string): string; function reverse<T>(arr: T[]): T[]; function reverse<T>(stringOrArray: string | T[]): string | T[] { if (typeof 阅读全文
posted @ 2020-10-06 18:20 Zhentiw 阅读(158) 评论(0) 推荐(0)
摘要: class Pizza { constructor(private name: string, private price: number) {} } class List<T> { private list: T[]; addItem(item: T): void { this.list.push 阅读全文
posted @ 2020-10-06 18:14 Zhentiw 阅读(84) 评论(0) 推荐(0)
上一页 1 ··· 175 176 177 178 179 180 181 182 183 ··· 494 下一页