SlideShare ist ein Scribd-Unternehmen logo
1 von 11
JavascriptTips and Tricks @EBvi
Declaring a Function function foo() {} var bar = function() {} The difference is that foo is defined at parse-time for a script block, whereas bar is defined at run-time.
Anonymous function (function (){})
Different ways of calling functions alert (“Hello, World!"); (alert) (“Hello, World!"); (function(x,y,z) {return (x+y+z)}) (1, 2, 3);
Using functional concepts Functions need not have names all the time. Functions can be assigned to variables like other values. A function expression can be written and enclosed in parentheses for application later. Functions can be passed as arguments to other functions.
JS does not have block scope. varx = 1;  {    var x = 2;  }  alert(x); // outputs 2 Block statements do not introduce a scope.
{} {} is object notation in JavaScript. An extremely terse and flexible way to pass information.
; At the end of the last script without a ; on the end. If you have a ; at the start on yours, it's safe.
++ and -- The ++ (increment) and -- (decrement) operators have been known to contribute to bad code by encouraging excessive trickiness. They are second only to faulty architecture in enabling to viruses and other security menaces. There is a plusplus option that prohibits the use of these operators. - Douglas Crockford
use === and !== instead of == and != == is not transitive. If you use === it would give false for all of these statements as expected.
Reference http://stackoverflow.com/questions http://en.wikipedia.org/wiki/Unobtrusive_JavaScript http://javascript.crockford.com http://www.ibm.com/developerworks/library/wa-javascript.html https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Statements JavaScript: The Good Parts

Weitere ähnliche Inhalte

Was ist angesagt?

Function overloading(C++)
Function overloading(C++)Function overloading(C++)
Function overloading(C++)Ritika Sharma
 
Function overloading and overriding
Function overloading and overridingFunction overloading and overriding
Function overloading and overridingRajab Ali
 
Master in javascript
Master in javascriptMaster in javascript
Master in javascriptRobbin Zhao
 
Overview of c language
Overview of c languageOverview of c language
Overview of c languageshalini392
 
pointer, virtual function and polymorphism
pointer, virtual function and polymorphismpointer, virtual function and polymorphism
pointer, virtual function and polymorphismramya marichamy
 
Variables: names, bindings, type, scope
Variables: names, bindings, type, scopeVariables: names, bindings, type, scope
Variables: names, bindings, type, scopesuthi
 
Missilecommand
MissilecommandMissilecommand
MissilecommandSusan Gold
 
C# for C++ programmers
C# for C++ programmersC# for C++ programmers
C# for C++ programmersMark Whitaker
 
C++ programming introduction
C++ programming introductionC++ programming introduction
C++ programming introductionsandeep54552
 
An overview of java script in 2015 (ecma script 6)
An overview of java script in 2015 (ecma script 6)An overview of java script in 2015 (ecma script 6)
An overview of java script in 2015 (ecma script 6)LearningTech
 
C++ vs C#
C++ vs C#C++ vs C#
C++ vs C#sudipv
 
ARC - Moqod mobile talks meetup
ARC - Moqod mobile talks meetupARC - Moqod mobile talks meetup
ARC - Moqod mobile talks meetupMoqod
 
Interpreter Design Pattern
Interpreter Design PatternInterpreter Design Pattern
Interpreter Design Patternsreymoch
 

Was ist angesagt? (20)

Function overloading(C++)
Function overloading(C++)Function overloading(C++)
Function overloading(C++)
 
Compile time polymorphism
Compile time polymorphismCompile time polymorphism
Compile time polymorphism
 
Some basic FP concepts
Some basic FP conceptsSome basic FP concepts
Some basic FP concepts
 
Function overloading and overriding
Function overloading and overridingFunction overloading and overriding
Function overloading and overriding
 
Master in javascript
Master in javascriptMaster in javascript
Master in javascript
 
Overview of c language
Overview of c languageOverview of c language
Overview of c language
 
Swift, swiftly
Swift, swiftlySwift, swiftly
Swift, swiftly
 
pointer, virtual function and polymorphism
pointer, virtual function and polymorphismpointer, virtual function and polymorphism
pointer, virtual function and polymorphism
 
Cpp reference card
Cpp reference cardCpp reference card
Cpp reference card
 
Variables: names, bindings, type, scope
Variables: names, bindings, type, scopeVariables: names, bindings, type, scope
Variables: names, bindings, type, scope
 
Missilecommand
MissilecommandMissilecommand
Missilecommand
 
Ppt of c vs c#
Ppt of c vs c#Ppt of c vs c#
Ppt of c vs c#
 
Lecture06
Lecture06Lecture06
Lecture06
 
C# for C++ programmers
C# for C++ programmersC# for C++ programmers
C# for C++ programmers
 
C++ programming introduction
C++ programming introductionC++ programming introduction
C++ programming introduction
 
An overview of java script in 2015 (ecma script 6)
An overview of java script in 2015 (ecma script 6)An overview of java script in 2015 (ecma script 6)
An overview of java script in 2015 (ecma script 6)
 
C++ vs C#
C++ vs C#C++ vs C#
C++ vs C#
 
ARC - Moqod mobile talks meetup
ARC - Moqod mobile talks meetupARC - Moqod mobile talks meetup
ARC - Moqod mobile talks meetup
 
Modern C++
Modern C++Modern C++
Modern C++
 
Interpreter Design Pattern
Interpreter Design PatternInterpreter Design Pattern
Interpreter Design Pattern
 

Andere mochten auch

Almacenamiento de datos
Almacenamiento de datosAlmacenamiento de datos
Almacenamiento de datosAriel Medina
 
Trafikoa 2011 eu_mshp07a-ud dbh_mugikortasun segururako hezkuntza programazio...
Trafikoa 2011 eu_mshp07a-ud dbh_mugikortasun segururako hezkuntza programazio...Trafikoa 2011 eu_mshp07a-ud dbh_mugikortasun segururako hezkuntza programazio...
Trafikoa 2011 eu_mshp07a-ud dbh_mugikortasun segururako hezkuntza programazio...patxigalarraga
 
Tracks restaurant back office solution - Introductory presentation
Tracks restaurant back office solution - Introductory presentationTracks restaurant back office solution - Introductory presentation
Tracks restaurant back office solution - Introductory presentationjwtownsendjr1
 
Técnicas del futbol
Técnicas del futbolTécnicas del futbol
Técnicas del futbolmatiaspablo1
 
Skills audits and staff development conference 22 february 2016
Skills audits and staff development conference 22 february 2016Skills audits and staff development conference 22 february 2016
Skills audits and staff development conference 22 february 2016Charles Cotter, PhD
 
Garantías constitucionales en ecuador
Garantías constitucionales en ecuadorGarantías constitucionales en ecuador
Garantías constitucionales en ecuadorcristianpoj
 
Trafikoa 2014 eu_ud lh5-6_bizikletan_formaccio-ingurugela
Trafikoa 2014 eu_ud lh5-6_bizikletan_formaccio-ingurugelaTrafikoa 2014 eu_ud lh5-6_bizikletan_formaccio-ingurugela
Trafikoa 2014 eu_ud lh5-6_bizikletan_formaccio-ingurugelapatxigalarraga
 
Miniature Needlework - Geometic Rose Rug
Miniature Needlework - Geometic Rose RugMiniature Needlework - Geometic Rose Rug
Miniature Needlework - Geometic Rose RugElizabeth Plain
 
“Global Trends and Patterns of Violent Extremism: Finding New Responses”
“Global Trends and Patterns of Violent  Extremism: Finding New Responses”“Global Trends and Patterns of Violent  Extremism: Finding New Responses”
“Global Trends and Patterns of Violent Extremism: Finding New Responses”UOC Universitat Oberta de Catalunya
 
Optimising Content Spending with Analytics
Optimising Content Spending with AnalyticsOptimising Content Spending with Analytics
Optimising Content Spending with AnalyticsDr. Haxel Consult
 
Thieme Publishers: New Vistas for the Pharmaceutical Industry: Combining full...
Thieme Publishers: New Vistas for the Pharmaceutical Industry: Combining full...Thieme Publishers: New Vistas for the Pharmaceutical Industry: Combining full...
Thieme Publishers: New Vistas for the Pharmaceutical Industry: Combining full...Dr. Haxel Consult
 
Fracciones para niños
Fracciones para niñosFracciones para niños
Fracciones para niñosEditorial MD
 
Trafikoa 2014 es_ud ep5-6_en bicicleta_formaccio-ingurugela
Trafikoa 2014 es_ud ep5-6_en bicicleta_formaccio-ingurugelaTrafikoa 2014 es_ud ep5-6_en bicicleta_formaccio-ingurugela
Trafikoa 2014 es_ud ep5-6_en bicicleta_formaccio-ingurugelapatxigalarraga
 

Andere mochten auch (18)

Powerpoint 2009 Introduction
Powerpoint 2009   IntroductionPowerpoint 2009   Introduction
Powerpoint 2009 Introduction
 
结网
结网结网
结网
 
Almacenamiento de datos
Almacenamiento de datosAlmacenamiento de datos
Almacenamiento de datos
 
Trafikoa 2011 eu_mshp07a-ud dbh_mugikortasun segururako hezkuntza programazio...
Trafikoa 2011 eu_mshp07a-ud dbh_mugikortasun segururako hezkuntza programazio...Trafikoa 2011 eu_mshp07a-ud dbh_mugikortasun segururako hezkuntza programazio...
Trafikoa 2011 eu_mshp07a-ud dbh_mugikortasun segururako hezkuntza programazio...
 
Boletin Economico
Boletin Economico Boletin Economico
Boletin Economico
 
Entorno de windows
Entorno de windowsEntorno de windows
Entorno de windows
 
Tracks restaurant back office solution - Introductory presentation
Tracks restaurant back office solution - Introductory presentationTracks restaurant back office solution - Introductory presentation
Tracks restaurant back office solution - Introductory presentation
 
Técnicas del futbol
Técnicas del futbolTécnicas del futbol
Técnicas del futbol
 
Skills audits and staff development conference 22 february 2016
Skills audits and staff development conference 22 february 2016Skills audits and staff development conference 22 february 2016
Skills audits and staff development conference 22 february 2016
 
Garantías constitucionales en ecuador
Garantías constitucionales en ecuadorGarantías constitucionales en ecuador
Garantías constitucionales en ecuador
 
Trafikoa 2014 eu_ud lh5-6_bizikletan_formaccio-ingurugela
Trafikoa 2014 eu_ud lh5-6_bizikletan_formaccio-ingurugelaTrafikoa 2014 eu_ud lh5-6_bizikletan_formaccio-ingurugela
Trafikoa 2014 eu_ud lh5-6_bizikletan_formaccio-ingurugela
 
Miniature Needlework - Geometic Rose Rug
Miniature Needlework - Geometic Rose RugMiniature Needlework - Geometic Rose Rug
Miniature Needlework - Geometic Rose Rug
 
“Global Trends and Patterns of Violent Extremism: Finding New Responses”
“Global Trends and Patterns of Violent  Extremism: Finding New Responses”“Global Trends and Patterns of Violent  Extremism: Finding New Responses”
“Global Trends and Patterns of Violent Extremism: Finding New Responses”
 
Optimising Content Spending with Analytics
Optimising Content Spending with AnalyticsOptimising Content Spending with Analytics
Optimising Content Spending with Analytics
 
Thieme Publishers: New Vistas for the Pharmaceutical Industry: Combining full...
Thieme Publishers: New Vistas for the Pharmaceutical Industry: Combining full...Thieme Publishers: New Vistas for the Pharmaceutical Industry: Combining full...
Thieme Publishers: New Vistas for the Pharmaceutical Industry: Combining full...
 
Fracciones para niños
Fracciones para niñosFracciones para niños
Fracciones para niños
 
Trafikoa 2014 es_ud ep5-6_en bicicleta_formaccio-ingurugela
Trafikoa 2014 es_ud ep5-6_en bicicleta_formaccio-ingurugelaTrafikoa 2014 es_ud ep5-6_en bicicleta_formaccio-ingurugela
Trafikoa 2014 es_ud ep5-6_en bicicleta_formaccio-ingurugela
 
Gewichtsreduktion
GewichtsreduktionGewichtsreduktion
Gewichtsreduktion
 

Ähnlich wie Javascript Tip and Triks

2014 holden - databricks umd scala crash course
2014   holden - databricks umd scala crash course2014   holden - databricks umd scala crash course
2014 holden - databricks umd scala crash courseHolden Karau
 
Explaining ES6: JavaScript History and What is to Come
Explaining ES6: JavaScript History and What is to ComeExplaining ES6: JavaScript History and What is to Come
Explaining ES6: JavaScript History and What is to ComeCory Forsyth
 
JavaScript: The Language
JavaScript: The LanguageJavaScript: The Language
JavaScript: The LanguageEngage Software
 
Deep drive into rust programming language
Deep drive into rust programming languageDeep drive into rust programming language
Deep drive into rust programming languageVigneshwer Dhinakaran
 
Scala is java8.next()
Scala is java8.next()Scala is java8.next()
Scala is java8.next()daewon jeong
 
CodeFest 2014. Axel Rauschmayer — JavaScript’s variables: scopes, environment...
CodeFest 2014. Axel Rauschmayer — JavaScript’s variables: scopes, environment...CodeFest 2014. Axel Rauschmayer — JavaScript’s variables: scopes, environment...
CodeFest 2014. Axel Rauschmayer — JavaScript’s variables: scopes, environment...CodeFest
 
JavaScript Interview Questions 2023
JavaScript Interview Questions 2023JavaScript Interview Questions 2023
JavaScript Interview Questions 2023Laurence Svekis ✔
 
Idiomatic Javascript (ES5 to ES2015+)
Idiomatic Javascript (ES5 to ES2015+)Idiomatic Javascript (ES5 to ES2015+)
Idiomatic Javascript (ES5 to ES2015+)David Atchley
 
JavaScript Closures for Dummies & JavaScript prototype, closures and OOP.
JavaScript Closures for Dummies & JavaScript prototype, closures and OOP.JavaScript Closures for Dummies & JavaScript prototype, closures and OOP.
JavaScript Closures for Dummies & JavaScript prototype, closures and OOP.Jin-Hwa Kim
 
golang_refcard.pdf
golang_refcard.pdfgolang_refcard.pdf
golang_refcard.pdfSpam92
 
Kotlin- Basic to Advance
Kotlin- Basic to Advance Kotlin- Basic to Advance
Kotlin- Basic to Advance Coder Tech
 

Ähnlich wie Javascript Tip and Triks (20)

Modern JS with ES6
Modern JS with ES6Modern JS with ES6
Modern JS with ES6
 
Web 4 | Core JavaScript
Web 4 | Core JavaScriptWeb 4 | Core JavaScript
Web 4 | Core JavaScript
 
ECMAScript 2015
ECMAScript 2015ECMAScript 2015
ECMAScript 2015
 
2014 holden - databricks umd scala crash course
2014   holden - databricks umd scala crash course2014   holden - databricks umd scala crash course
2014 holden - databricks umd scala crash course
 
Books
BooksBooks
Books
 
Function in C++
Function in C++Function in C++
Function in C++
 
Explaining ES6: JavaScript History and What is to Come
Explaining ES6: JavaScript History and What is to ComeExplaining ES6: JavaScript History and What is to Come
Explaining ES6: JavaScript History and What is to Come
 
Licão 13 functions
Licão 13 functionsLicão 13 functions
Licão 13 functions
 
Scope and closures
Scope and closuresScope and closures
Scope and closures
 
JavaScript: The Language
JavaScript: The LanguageJavaScript: The Language
JavaScript: The Language
 
Deep drive into rust programming language
Deep drive into rust programming languageDeep drive into rust programming language
Deep drive into rust programming language
 
Scala is java8.next()
Scala is java8.next()Scala is java8.next()
Scala is java8.next()
 
oojs
oojsoojs
oojs
 
CodeFest 2014. Axel Rauschmayer — JavaScript’s variables: scopes, environment...
CodeFest 2014. Axel Rauschmayer — JavaScript’s variables: scopes, environment...CodeFest 2014. Axel Rauschmayer — JavaScript’s variables: scopes, environment...
CodeFest 2014. Axel Rauschmayer — JavaScript’s variables: scopes, environment...
 
JavaScript Interview Questions 2023
JavaScript Interview Questions 2023JavaScript Interview Questions 2023
JavaScript Interview Questions 2023
 
Idiomatic Javascript (ES5 to ES2015+)
Idiomatic Javascript (ES5 to ES2015+)Idiomatic Javascript (ES5 to ES2015+)
Idiomatic Javascript (ES5 to ES2015+)
 
Es6 to es5
Es6 to es5Es6 to es5
Es6 to es5
 
JavaScript Closures for Dummies & JavaScript prototype, closures and OOP.
JavaScript Closures for Dummies & JavaScript prototype, closures and OOP.JavaScript Closures for Dummies & JavaScript prototype, closures and OOP.
JavaScript Closures for Dummies & JavaScript prototype, closures and OOP.
 
golang_refcard.pdf
golang_refcard.pdfgolang_refcard.pdf
golang_refcard.pdf
 
Kotlin- Basic to Advance
Kotlin- Basic to Advance Kotlin- Basic to Advance
Kotlin- Basic to Advance
 

Mehr von Eb Styles

잘 알고 있습니까? html + css <#1>
잘 알고 있습니까? html + css <#1>잘 알고 있습니까? html + css <#1>
잘 알고 있습니까? html + css <#1>Eb Styles
 
보다 나은 웹 어플리케이션 설계
보다 나은 웹 어플리케이션 설계보다 나은 웹 어플리케이션 설계
보다 나은 웹 어플리케이션 설계Eb Styles
 
Web accessibility
Web accessibilityWeb accessibility
Web accessibilityEb Styles
 
Web accessibility
Web accessibilityWeb accessibility
Web accessibilityEb Styles
 
Web standard 2
Web standard 2Web standard 2
Web standard 2Eb Styles
 
Web standard 1
Web standard 1Web standard 1
Web standard 1Eb Styles
 

Mehr von Eb Styles (9)

잘 알고 있습니까? html + css <#1>
잘 알고 있습니까? html + css <#1>잘 알고 있습니까? html + css <#1>
잘 알고 있습니까? html + css <#1>
 
보다 나은 웹 어플리케이션 설계
보다 나은 웹 어플리케이션 설계보다 나은 웹 어플리케이션 설계
보다 나은 웹 어플리케이션 설계
 
Web accessibility
Web accessibilityWeb accessibility
Web accessibility
 
Web accessibility
Web accessibilityWeb accessibility
Web accessibility
 
Debugger
DebuggerDebugger
Debugger
 
Css3
Css3Css3
Css3
 
Web standard 2
Web standard 2Web standard 2
Web standard 2
 
Web standard 1
Web standard 1Web standard 1
Web standard 1
 
Doctype
DoctypeDoctype
Doctype
 

Kürzlich hochgeladen

Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 

Kürzlich hochgeladen (20)

Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 

Javascript Tip and Triks

  • 2. Declaring a Function function foo() {} var bar = function() {} The difference is that foo is defined at parse-time for a script block, whereas bar is defined at run-time.
  • 4. Different ways of calling functions alert (“Hello, World!"); (alert) (“Hello, World!"); (function(x,y,z) {return (x+y+z)}) (1, 2, 3);
  • 5. Using functional concepts Functions need not have names all the time. Functions can be assigned to variables like other values. A function expression can be written and enclosed in parentheses for application later. Functions can be passed as arguments to other functions.
  • 6. JS does not have block scope. varx = 1; {   var x = 2; } alert(x); // outputs 2 Block statements do not introduce a scope.
  • 7. {} {} is object notation in JavaScript. An extremely terse and flexible way to pass information.
  • 8. ; At the end of the last script without a ; on the end. If you have a ; at the start on yours, it's safe.
  • 9. ++ and -- The ++ (increment) and -- (decrement) operators have been known to contribute to bad code by encouraging excessive trickiness. They are second only to faulty architecture in enabling to viruses and other security menaces. There is a plusplus option that prohibits the use of these operators. - Douglas Crockford
  • 10. use === and !== instead of == and != == is not transitive. If you use === it would give false for all of these statements as expected.
  • 11. Reference http://stackoverflow.com/questions http://en.wikipedia.org/wiki/Unobtrusive_JavaScript http://javascript.crockford.com http://www.ibm.com/developerworks/library/wa-javascript.html https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Statements JavaScript: The Good Parts