Node

Adrian Yang

Adrian Yang

Front End Engineer

Node.js

基于ChromeV8 引擎的 Javascript 运行时

image-20200714203552836

NodeJS 优点

  1. 异步非阻塞的I/O(I/O线程池)
  2. 特别适用于I/O密集型应用
  3. 事件循环机制 (与浏览器不一样)
  4. 单线程 (成也单线程,败也单线程,对比java服务器)
  5. 跨平台

module

Adrian Yang

Adrian Yang

Front End Engineer

对于前端模块化的理解

什么是模块 什么是模块化?

将一个复杂程序依据一定规则拆分成几个块,并进行组合在一起。

块的内部数据或实现是私有的,只是向外部暴露一些结果方法 和 与其他外部模块的通信

React

Adrian Yang

Adrian Yang

Front End Engineer @ Facebook

Lektion 1 React

1.1 React

  1. 用于构建动态用户界面的 JavaScript库 (只关注于View)
  2. 由 Facebook 开源

React 特点

  1. Declarative 声明式编码
  2. Component-Based 组件化编码
  3. Learn Once Write Anywhere (React Native / 支持客户端与服务端渲染)
  4. 高效
  5. 单项数据流

JavascriptProblem

Adrian Yang

Adrian Yang

Front End Engineer @ Facebook

堆栈内存及闭包作用域

  • JS 8 中数据类型 及区别
  • JS 堆栈内存的运行机制
  • 变量提升机制
  • 作用域 和 作用域链
  • 闭包的两大作用: 保存 / 保护
  • JS 的编译机制: VO AO GO
  • JS 高级编程技巧 惰性函数 合理化函数 高阶函数

freecodecamp

Adrian Yang

Adrian Yang

Front End Engineer @ Facebook

Responsive Web Design Certification

Applied Visual Design

Create Visual Balance Using the text-align Property

text-align: justify;
causes all lines of text except the last line to meet the left and right edges of the line box.
即每行的左右两端都紧贴行的边缘。
text-align: center; centers the text
text-align: right; right-aligns the text
And text-align: left; (the default) left-aligns the text.

djust the Width of an Element Using the width Property

img {
width: 220px;
}

smallProject

Adrian Yang

Adrian Yang

Front End Engineer @ Facebook

贪吃蛇

案例目标

游戏的目的是用来体会JavaScript高级语法的使用 不需要具备抽象对象的能力,使用面向对象的方式分析问题,需要一个漫长的过程。

功能实现

搭建页面

放一个容器盛放游戏场景 div#map,设置样式

#map {
width: 800px;
height: 600px;
background-color: #ccc;
position: relative;
}

Javascript

Adrian Yang

Adrian Yang

Front End Engineer @ Facebook

Javascript 高级程序设计

L4 变量 作用域 和 内存问题

探讨了 JavaScript处理松散类型的变量

还讨论了 原始值 和 引用值之间的差别 以及变量有关的执行环境的相应内容

最后 通过介绍JavaScript的垃圾收集机制 解释了变量在退出作用域时释放其内存的问题

本章内容:

  • 理解基本类型和引用类型的数值
  • 理解执行环境
  • 理解垃圾收集

JS 变量松散类型的本质,决定了它只是在特定的事件用于保存特定值的一个名字而已

由于不存在定义某个变量必须要保存何种类型值的规则,变量的数值及其数据类型可以在脚本的生命周期内改变 (JS变量实际上的复杂程度不止于此