-
any? [{ |obj| block }] → true or falsemeans could either accept 0 or 1{ |obj| block }block. -
send(symbol [, args...]) → objmeans could either accept 0 or many argumetns. if symobol method accept block, then may also appen that block to it, e.g.define_method.
- Item 6
- Ruby find a method by searching its suplerclass until to the top, then back to original class then searching the hierachy for
method_missingagain.
Internal of prototype and inheritance(chinese)
https://imazole.wordpress.com/2013/12/23/javascript-prototype-chain/
https://www.byvoid.com/blog/javascript-object-prototype
_and$can be used to name a variable or function as first letter. Digits can not be first letter for naming variable or function.
- Constraint and auto layout.
- Auto Layout Concepts
- The attributes
leadingandtrailingare the same asleftandrightfor left-to-right languages such as English, but in a right-to-left environment such as Hebrew or Arabic,leadingandtrailingare the same asrightandleft. - Constraints are cumulative, and do not override each other. Setting a second width constraint for a view does not remove or alter the first width constraint.
@IBOutlet weak var prpoerty.
#Learning CSS Note
###1. Class Selector
If two class selector rules ovelap same properties, the later rule in css file will take it. So it is called css.
If rule selector select element, then more restrictive element will apply that rule. ex: div prior then body.
The precedence is more specific selector will take the higer priority.
#Weird Part Of JS
-
thisis global object if there does not have receiver. If so, it also imply it is awindowobject,document === window.document. -
JS engine create
thisexecution context(window object) in bottom of execution stack and run other execution context which is in top of it for you. -
When you declare a
varor define as a function(function expression or function statement), you can find it throughwindow.func()orfunc()in global environment. -
Hoisting:
varandfuncare all firstly initialize but not assigned its value yet until the later code assign it. Check code example below.
##0. Mass Assignment
-
Mass assignment allows us to set a bunch of attributes at once:
attrs = { :first => "John", :last => "Doe", :email => "john.doe@example.com"} user = User.new(attrs)