Tuesday, December 9, 2014

JavaScript: Day 1

Starting Objective

Find resources for learning JavaScript, PHP,  Python.

Action

Looked at Google examples.

Findings

The examples are something I would need to parse to determine the syntax.    Seems like too much work for the benefit.  

Refined Immediate Objective

Select and start a tutorial on JavaScript or PHP that explains the basics of the syntax of a module

  • Module declaration
  • Module ending 
  • Data Declaration: Public, Private, Other???
  • If...Then....Else
  • Case 
  • Looping
  • Comments

Longer Term Learning Objectives

  • How users interact with modules, e.g.,
    • Functions like VBAs MsgBox and MsgInput
    • Programmer developed forms
    • Controls displayed on documents/spreadsheets/slides
    • Triggering from a UI dialogue, e.g., F8 in MS-Office presents a list of macros
    • Embedding/including/exploiting User Defined Functions (UDFs) in documents/spreadsheets/slides
  • How modules interact with other technical components
    • Invoke/Call
    • Parameters & Arguments
    • Event Models
    • Environment variables
    • Creating new documents and sub-components, e.g. spreadsheets in a workbook.
    • Finding currently open documents
    • Opening/saving to folder/file structures and URLs

Action

Selected and started CodeCademy's intro to JavaScript.

Learned


  • "//" is the beginning of a comment
  • Comment can be at the beginning of a line or at then end
  • Once a comment is started, the rest of the line is a comment
  • A semi-colon(";") ends a statement
  • A semi-colon is not needed at the end of a comment line
  • Adding a semi-colon after a comment does not allow a statement after it on the same line
  • Basic math operators for addition, subtraction, multiplication and division work as expected ("+","-","/", and "*" respectively
  • Remainder function is called "modulo" and the operator is "%".  VBA and Excel us "x mod y" and "mod(x,y)" respectively
  • The carat ("^") is not the symbol for exponentiation.

  • Variable declaration is done with a "var" statement, e.g. "var myname"
  • Assignment of a value to a variable is done with the equals ("=") sign.
  • The equivalent of MsgBox is confirm(<string>)
  • The equivalent of InputBox is prompt(<string>)
  • Default buttons for confirm() are "OK" and "Cancel"
  • ".length" is an property, not a method.
  • Semi-colon indicates the end of a statement
  • Braces ("{}") define code blocks
  • If no braces, the code block is one statement
  • A code block is a series of statements executed together or not at all.  For example, when there
  • Syntax for If ... Else is "if (<condition>)  <true code block> <nl> else <else code block>
  • Comparison operators are 
    • > Greater than
    • < Less than
    • <= Less than or equal to
    • >= Greater than or equal to
    • === Equal to
    • !== Not equal to
  • JavaScript is case sensitive.  Operators used so far are all lower case.

To Be Learned

  • Are their other parameters for confirm(), e.g. Title and Help?
  • Are their other button options for confirm()?
  • Are their other parameters for prompt(), e.g. Title and Help?
  • Are their other button options for prompt()?
  • What is a "code block"?
  • What is the symbol for exponentiation, "**", as in "2**3 = 8"?


No comments:

Post a Comment