上一页 1 ··· 327 328 329 330 331 332 333 334 335 ··· 498 下一页
摘要: Write a function, remove_duplicates that takes a list as its argument and returns a new list containing the unique elements of the original list. The 阅读全文
posted @ 2017-11-21 14:52 Zhentiw 阅读(352) 评论(0) 推荐(0)
摘要: Let's introduce a new string method, join: Also note thatjoin will trigger an error if we try to join anything other than strings. For example: 阅读全文
posted @ 2017-11-21 14:45 Zhentiw 阅读(509) 评论(0) 推荐(0)
摘要: In addition to accessing individual elements from a list we can use Python's slicing notation to access a subsequence of a list. Consider this list of 阅读全文
posted @ 2017-11-21 14:02 Zhentiw 阅读(356) 评论(0) 推荐(0)
摘要: A symbol is a unique and immutable data type that is often used to identify object properties. To create a symbol, you write Symbol() with an optional 阅读全文
posted @ 2017-11-17 14:38 Zhentiw 阅读(211) 评论(0) 推荐(0)
摘要: One particularly useful string method is format. The format method is used to construct strings by inserting values into template strings. Consider th 阅读全文
posted @ 2017-11-13 20:13 Zhentiw 阅读(268) 评论(0) 推荐(0)
摘要: For example we have an object: We shallow copy it: Verify that shallowCopy is not todo: Change text prop of shallowCopy to somethingelse: But if we wa 阅读全文
posted @ 2017-11-13 17:59 Zhentiw 阅读(280) 评论(0) 推荐(0)
摘要: TypeScript’s discriminated union types (aka tagged union types) allow you to model a finite set of alternative object shapes in the type system. The c 阅读全文
posted @ 2017-11-13 17:48 Zhentiw 阅读(390) 评论(0) 推荐(0)
摘要: ES6 class with extends and super: How this is written in ES5: We use 'Tree.call(this)' to pass context, 'this' is refer to Maple because of Clourse. T 阅读全文
posted @ 2017-11-11 03:38 Zhentiw 阅读(251) 评论(0) 推荐(0)
摘要: TypeScript 2.0 introduced the readonly modifier which can be added to a property or index signature declaration. It helps prevent against unintended p 阅读全文
posted @ 2017-11-09 21:06 Zhentiw 阅读(286) 评论(0) 推荐(0)
摘要: # Python's list comprehensions are awesome. vals = [expression for value in collection if condition] # This is equivalent to: vals = [] for value in collection: if condition:... 阅读全文
posted @ 2017-11-09 19:04 Zhentiw 阅读(186) 评论(0) 推荐(0)
上一页 1 ··· 327 328 329 330 331 332 333 334 335 ··· 498 下一页