-
any? [{ |obj| block }] → true or false
means could either accept 0 or 1{ |obj| block }
block. -
send(symbol [, args...]) → obj
means 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_missing
again.
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
leading
andtrailing
are the same asleft
andright
for left-to-right languages such as English, but in a right-to-left environment such as Hebrew or Arabic,leading
andtrailing
are the same asright
andleft
. - 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
-
this
is global object if there does not have receiver. If so, it also imply it is awindow
object,document === window.document
. -
JS engine create
this
execution 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
var
or define as a function(function expression or function statement), you can find it throughwindow.func()
orfunc()
in global environment. -
Hoisting:
var
andfunc
are 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)