Submit Search
Upload
簡單介紹JavaScript參數傳遞
•
Download as PPTX, PDF
•
17 likes
•
6,857 views
林儀泰 Tommy Lin
Follow
簡單介紹JavaScript參數傳遞
Read less
Read more
Presentations & Public Speaking
Report
Share
Report
Share
1 of 18
Download now
Recommended
AWS Billing Deep Dive (DMG203) | AWS re:Invent 2013
AWS Billing Deep Dive (DMG203) | AWS re:Invent 2013
Amazon Web Services
漫談 CSS 架構方法 - 以 OOCSS, SMACSS, BEM 為例
漫談 CSS 架構方法 - 以 OOCSS, SMACSS, BEM 為例
Kuro Hsu
Best Practices in Planning a Large-Scale Migration to AWS - AWS Online Tech T...
Best Practices in Planning a Large-Scale Migration to AWS - AWS Online Tech T...
Amazon Web Services
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
Amazon Web Services Korea
AWS CLOUD 2017 - AWS 클라우드 비용 최적화 전략 (오길재 테크니컬 어카운트 매니저 & 이범석 테크니컬 어카운트 매니저)
AWS CLOUD 2017 - AWS 클라우드 비용 최적화 전략 (오길재 테크니컬 어카운트 매니저 & 이범석 테크니컬 어카운트 매니저)
Amazon Web Services Korea
복잡한 권한신청문제 ConsoleMe로 해결하기 - 손건 (AB180) :: AWS Community Day Online 2021
복잡한 권한신청문제 ConsoleMe로 해결하기 - 손건 (AB180) :: AWS Community Day Online 2021
AWSKRUG - AWS한국사용자모임
Building Data Lakes for Analytics on AWS
Building Data Lakes for Analytics on AWS
Amazon Web Services
Protecting Your Data With AWS KMS and AWS CloudHSM
Protecting Your Data With AWS KMS and AWS CloudHSM
Amazon Web Services
Recommended
AWS Billing Deep Dive (DMG203) | AWS re:Invent 2013
AWS Billing Deep Dive (DMG203) | AWS re:Invent 2013
Amazon Web Services
漫談 CSS 架構方法 - 以 OOCSS, SMACSS, BEM 為例
漫談 CSS 架構方法 - 以 OOCSS, SMACSS, BEM 為例
Kuro Hsu
Best Practices in Planning a Large-Scale Migration to AWS - AWS Online Tech T...
Best Practices in Planning a Large-Scale Migration to AWS - AWS Online Tech T...
Amazon Web Services
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
Amazon Web Services Korea
AWS CLOUD 2017 - AWS 클라우드 비용 최적화 전략 (오길재 테크니컬 어카운트 매니저 & 이범석 테크니컬 어카운트 매니저)
AWS CLOUD 2017 - AWS 클라우드 비용 최적화 전략 (오길재 테크니컬 어카운트 매니저 & 이범석 테크니컬 어카운트 매니저)
Amazon Web Services Korea
복잡한 권한신청문제 ConsoleMe로 해결하기 - 손건 (AB180) :: AWS Community Day Online 2021
복잡한 권한신청문제 ConsoleMe로 해결하기 - 손건 (AB180) :: AWS Community Day Online 2021
AWSKRUG - AWS한국사용자모임
Building Data Lakes for Analytics on AWS
Building Data Lakes for Analytics on AWS
Amazon Web Services
Protecting Your Data With AWS KMS and AWS CloudHSM
Protecting Your Data With AWS KMS and AWS CloudHSM
Amazon Web Services
Secure Virtual Private Cloud(VPC)를 활용한 보안성 강화와 비용절감 - 안경진 부장, 포티넷 코리아 :: AWS ...
Secure Virtual Private Cloud(VPC)를 활용한 보안성 강화와 비용절감 - 안경진 부장, 포티넷 코리아 :: AWS ...
Amazon Web Services Korea
Data Migration Using AWS Snowball, Snowball Edge & Snowmobile
Data Migration Using AWS Snowball, Snowball Edge & Snowmobile
Amazon Web Services
AWS Application Migration Service-Hands-On Guide
AWS Application Migration Service-Hands-On Guide
Manas Mondal
Rest and Sling Resolution
Rest and Sling Resolution
DEEPAK KHETAWAT
Amazon S3 & Amazon Glacier - Object Storage Overview
Amazon S3 & Amazon Glacier - Object Storage Overview
Amazon Web Services
20190129 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
20190129 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
Amazon Web Services Japan
AWS S3 and GLACIER
AWS S3 and GLACIER
Mahesh Raj
20200721 AWS Black Belt Online Seminar AWS App Mesh
20200721 AWS Black Belt Online Seminar AWS App Mesh
Amazon Web Services Japan
A DIY Guide to Runbooks, Security Incident Reports, & Incident Response: AWS ...
A DIY Guide to Runbooks, Security Incident Reports, & Incident Response: AWS ...
Amazon Web Services
Object storage
Object storage
akash tambakad
AWS re:Invent 2016: Workshop: AWS S3 Deep-Dive Hands-On Workshop: Deploying a...
AWS re:Invent 2016: Workshop: AWS S3 Deep-Dive Hands-On Workshop: Deploying a...
Amazon Web Services
Messaging in the AWS Cloud
Messaging in the AWS Cloud
Amazon Web Services
Becoming an IAM Policy Ninja
Becoming an IAM Policy Ninja
Amazon Web Services
Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3
Jukka Zitting
AWS Black Belt Online Seminar Elastic Load Balancing
AWS Black Belt Online Seminar Elastic Load Balancing
Amazon Web Services Japan
ABD201-Big Data Architectural Patterns and Best Practices on AWS
ABD201-Big Data Architectural Patterns and Best Practices on AWS
Amazon Web Services
Unleash the Power of Temporary AWS Credentials (a.k.a. IAM roles) (SEC390-R1)...
Unleash the Power of Temporary AWS Credentials (a.k.a. IAM roles) (SEC390-R1)...
Amazon Web Services
AWS CLOUD 2017 - AWS 기반 하이브리드 클라우드 환경 구성 전략 (김용우 솔루션즈 아키텍트)
AWS CLOUD 2017 - AWS 기반 하이브리드 클라우드 환경 구성 전략 (김용우 솔루션즈 아키텍트)
Amazon Web Services Korea
Amazon SageMaker 모델 배포 방법 소개::김대근, AI/ML 스페셜리스트 솔루션즈 아키텍트, AWS::AWS AIML 스페셜 웨비나
Amazon SageMaker 모델 배포 방법 소개::김대근, AI/ML 스페셜리스트 솔루션즈 아키텍트, AWS::AWS AIML 스페셜 웨비나
Amazon Web Services Korea
Best Practices for Implementing Your Encryption Strategy Using AWS Key Manage...
Best Practices for Implementing Your Encryption Strategy Using AWS Key Manage...
Amazon Web Services
More Related Content
What's hot
Secure Virtual Private Cloud(VPC)를 활용한 보안성 강화와 비용절감 - 안경진 부장, 포티넷 코리아 :: AWS ...
Secure Virtual Private Cloud(VPC)를 활용한 보안성 강화와 비용절감 - 안경진 부장, 포티넷 코리아 :: AWS ...
Amazon Web Services Korea
Data Migration Using AWS Snowball, Snowball Edge & Snowmobile
Data Migration Using AWS Snowball, Snowball Edge & Snowmobile
Amazon Web Services
AWS Application Migration Service-Hands-On Guide
AWS Application Migration Service-Hands-On Guide
Manas Mondal
Rest and Sling Resolution
Rest and Sling Resolution
DEEPAK KHETAWAT
Amazon S3 & Amazon Glacier - Object Storage Overview
Amazon S3 & Amazon Glacier - Object Storage Overview
Amazon Web Services
20190129 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
20190129 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
Amazon Web Services Japan
AWS S3 and GLACIER
AWS S3 and GLACIER
Mahesh Raj
20200721 AWS Black Belt Online Seminar AWS App Mesh
20200721 AWS Black Belt Online Seminar AWS App Mesh
Amazon Web Services Japan
A DIY Guide to Runbooks, Security Incident Reports, & Incident Response: AWS ...
A DIY Guide to Runbooks, Security Incident Reports, & Incident Response: AWS ...
Amazon Web Services
Object storage
Object storage
akash tambakad
AWS re:Invent 2016: Workshop: AWS S3 Deep-Dive Hands-On Workshop: Deploying a...
AWS re:Invent 2016: Workshop: AWS S3 Deep-Dive Hands-On Workshop: Deploying a...
Amazon Web Services
Messaging in the AWS Cloud
Messaging in the AWS Cloud
Amazon Web Services
Becoming an IAM Policy Ninja
Becoming an IAM Policy Ninja
Amazon Web Services
Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3
Jukka Zitting
AWS Black Belt Online Seminar Elastic Load Balancing
AWS Black Belt Online Seminar Elastic Load Balancing
Amazon Web Services Japan
ABD201-Big Data Architectural Patterns and Best Practices on AWS
ABD201-Big Data Architectural Patterns and Best Practices on AWS
Amazon Web Services
Unleash the Power of Temporary AWS Credentials (a.k.a. IAM roles) (SEC390-R1)...
Unleash the Power of Temporary AWS Credentials (a.k.a. IAM roles) (SEC390-R1)...
Amazon Web Services
AWS CLOUD 2017 - AWS 기반 하이브리드 클라우드 환경 구성 전략 (김용우 솔루션즈 아키텍트)
AWS CLOUD 2017 - AWS 기반 하이브리드 클라우드 환경 구성 전략 (김용우 솔루션즈 아키텍트)
Amazon Web Services Korea
Amazon SageMaker 모델 배포 방법 소개::김대근, AI/ML 스페셜리스트 솔루션즈 아키텍트, AWS::AWS AIML 스페셜 웨비나
Amazon SageMaker 모델 배포 방법 소개::김대근, AI/ML 스페셜리스트 솔루션즈 아키텍트, AWS::AWS AIML 스페셜 웨비나
Amazon Web Services Korea
Best Practices for Implementing Your Encryption Strategy Using AWS Key Manage...
Best Practices for Implementing Your Encryption Strategy Using AWS Key Manage...
Amazon Web Services
What's hot
(20)
Secure Virtual Private Cloud(VPC)를 활용한 보안성 강화와 비용절감 - 안경진 부장, 포티넷 코리아 :: AWS ...
Secure Virtual Private Cloud(VPC)를 활용한 보안성 강화와 비용절감 - 안경진 부장, 포티넷 코리아 :: AWS ...
Data Migration Using AWS Snowball, Snowball Edge & Snowmobile
Data Migration Using AWS Snowball, Snowball Edge & Snowmobile
AWS Application Migration Service-Hands-On Guide
AWS Application Migration Service-Hands-On Guide
Rest and Sling Resolution
Rest and Sling Resolution
Amazon S3 & Amazon Glacier - Object Storage Overview
Amazon S3 & Amazon Glacier - Object Storage Overview
20190129 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
20190129 AWS Black Belt Online Seminar AWS Identity and Access Management (AW...
AWS S3 and GLACIER
AWS S3 and GLACIER
20200721 AWS Black Belt Online Seminar AWS App Mesh
20200721 AWS Black Belt Online Seminar AWS App Mesh
A DIY Guide to Runbooks, Security Incident Reports, & Incident Response: AWS ...
A DIY Guide to Runbooks, Security Incident Reports, & Incident Response: AWS ...
Object storage
Object storage
AWS re:Invent 2016: Workshop: AWS S3 Deep-Dive Hands-On Workshop: Deploying a...
AWS re:Invent 2016: Workshop: AWS S3 Deep-Dive Hands-On Workshop: Deploying a...
Messaging in the AWS Cloud
Messaging in the AWS Cloud
Becoming an IAM Policy Ninja
Becoming an IAM Policy Ninja
Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3
AWS Black Belt Online Seminar Elastic Load Balancing
AWS Black Belt Online Seminar Elastic Load Balancing
ABD201-Big Data Architectural Patterns and Best Practices on AWS
ABD201-Big Data Architectural Patterns and Best Practices on AWS
Unleash the Power of Temporary AWS Credentials (a.k.a. IAM roles) (SEC390-R1)...
Unleash the Power of Temporary AWS Credentials (a.k.a. IAM roles) (SEC390-R1)...
AWS CLOUD 2017 - AWS 기반 하이브리드 클라우드 환경 구성 전략 (김용우 솔루션즈 아키텍트)
AWS CLOUD 2017 - AWS 기반 하이브리드 클라우드 환경 구성 전략 (김용우 솔루션즈 아키텍트)
Amazon SageMaker 모델 배포 방법 소개::김대근, AI/ML 스페셜리스트 솔루션즈 아키텍트, AWS::AWS AIML 스페셜 웨비나
Amazon SageMaker 모델 배포 방법 소개::김대근, AI/ML 스페셜리스트 솔루션즈 아키텍트, AWS::AWS AIML 스페셜 웨비나
Best Practices for Implementing Your Encryption Strategy Using AWS Key Manage...
Best Practices for Implementing Your Encryption Strategy Using AWS Key Manage...
簡單介紹JavaScript參數傳遞
1.
Tommy Lin 林儀泰 FB/Email:tooto1985@gmail.com
2.
傳值參考(call by
value) ◦ 複製內容到新的參照上。 傳址參考(call by reference) ◦ 引用參考到新的參照上,修改或賦予新值都會改變原有參 照。 共享參考(call by sharing) ◦ 複製參考到新的參照上,修改會改變原有參照,但賦予新 值則會產生新的參考。
3.
傳值參考(call by
value) ◦ 複製內容到新的參照上。 傳址參考(call by reference) ◦ 引用參考到新的參照上,修改或賦予新值都會改變原有參 照。 共享參考(call by sharing) ◦ 複製參考到新的參照上,修改會改變原有參照,但賦予新 值則會產生新的參考。
4.
為什麼看起來像傳值? ◦ 原始(primitive)型別是不可變(immutable)的,無法修改 值,永遠只能賦予新值。
為什麼看起來像傳址? ◦ 物件(object)型別雖然是可變(mutable)的,修改會改變原 本參考,但賦予新值會產生新的參考。 ◦ 我們常常忽略了”賦予新值會改變原有參考”這個定義 ◦ 感覺好像是傳址參考 (實際上並不是喔)!
5.
6.
var aaa =
“string”; RAM 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 aaa “string” AddressVariable 0x01
7.
var aaa =
“string”; function run(xyz) { xyz=“world”; } RAM 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 Address run function run… Variable aaa “string” 0x01 0x03
8.
var aaa =
“string”; function run(xyz) { xyz=“world”; } run(aaa); RAM 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 Address xyz Variable run function run… aaa “string” 0x01 0x03 0x01
9.
var aaa =
“string”; function run(xyz) { xyz=“world”; } run(aaa); RAM 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 AddressVariable xyz run function run… aaa “string” 0x01 0x03 0x06 “world”
10.
var aaa =
“string”; function run(xyz) { xyz=“world”; } run(aaa); console.log(aaa); RAM 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 AddressVariable xyz run function run… aaa “string” 0x01 0x03 0x06 “world”
11.
12.
var aaa =
{name:”john”}; RAM 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 aaa {name:“john”} AddressVariable 0x01
13.
var aaa =
{name:”john”}; function run(xyz) { xyz.name=“mark”; } RAM 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 Address run function run… Variable aaa {name:“john”} 0x01 0x03
14.
var aaa =
{name:”john”}; function run(xyz) { xyz.name=“mark”; } run(aaa); RAM 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 AddressVariable run function run… aaa {name:“john”} 0x01 0x03 xyz 0x01
15.
var aaa =
{name:”john”}; function run(xyz) { xyz.name=“mark”; } run(aaa); RAM 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 AddressVariable run function run… aaa {name:“mark”} 0x01 0x03 xyz 0x01
16.
var aaa =
{name:”john”}; function run(xyz) { xyz.name=“mark”; } run(aaa); console.log(aaa); RAM 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 AddressVariable run function run… aaa {name:“mark”} 0x01 0x03 xyz 0x01
17.
有一種類似傳值參考或傳址參考的錯覺 但JavaScript中只有共享參考(call
by sharing)一種
18.
http://www.ecma-international.org/ecma-262/5.1/#sec-8.7 https://en.wikipedia.org/wiki/Evaluation_strategy#Call_by_sh aring
http://www.codeproject.com/Articles/882622/An- Illustrated-Guide-to-Parameter-Passing-in-JavaS http://www.jstips.co/en/know-the-passing-mechanism/ http://bosn.me/js/js-call-by-sharing/
Download now