Advertise Your Business With Us At Cheap Price, Call Or WhatsApp +2349021020979

to 3a lesson introduction javascript part

Hi Guest, kindly Login Or Register To Unlock More Advanced Features In Wapforum

Lesson: Introduction To Javascript (part 3a)
(10.8k )
Last Week Friday, We discuss On How To Add Javascript to a page.
Incase you missed check here for it

You Already know this lesson come every week (Friday)

Today am gonna teach you Some javascripts variables code
E.g in wapka you can display user using ::User:: ,
Same thing to mybb variables to display usertitle using $user.

In javascript, you need to know that, it will really help you writing your code easily..


Variable types are not important in JavaScript. They
may be interchanged as necessary. This means that
if a variable is a string one minute, it can be an
integer the next.

The basic variable types are:
'a' or
'@' or
'k' etc.

'hdttgs 8 -46hs () Get the idea' integer 0 or 1 or 2 or 3 or 4 etc. or -1 or -2 or -3 or -4 etc.

float (or double)
23.546 or -10.46 boolean true or false

A function; see the section on Functions object

An object; see the section on Object oriented programming array A type of object that can store variables in cells (see
below) regular expression A pattern that can be used to match strings or
substrings undefined A variable that has not been given a value yet null A variable that has been defined but has been
assigned the value of null

Integer and float are grouped together as
Character and string are grouped
together as 'string'.

Use the typeof operator to find out which variable
type your variable is.

Note, typeof will return
'object' for arrays, regular expressions and null in
most current browsers.

In future, browsers are
instead expected to return 'null' for null.

Defining variables
See the section on 'Referencing' subsection 'Avoiding referencing conflicts' to see how to choose names for your variables.

Normal variables It is good practice to pre-define all variables using
the v a r keyword (this is known as declaring the variables). It is possible to define the variable,
leaving its value undefined, or assigning a value
immediately, or even to define multiple variables in
a single command:

JavaScript is fairly lenient, and will create a global
variable if you forget to use the 'var' keyword, but
you assign a value to an undeclared variable (if you
attempt to read the value of an undeclared variable,
it will throw an error, as discussed below).

However, this can lead to problems if you end up accidentally overwriting variables from another
scope (this will be covered in the chapter on Functions). Once a variable is defined do not use
'var variable name' again unless you wish to completely overwrite the variable. It makes
no sense to redeclare a variable with the var keyword within the same scope, but browsers will
not complain if you do it.

These are some examples of how to define
variables, in this case, a string, a number, and a
regular expression:

Note that variables can be defined at any point in
your script, including inside a control structure that
causes that statement never to be executed.
However, no matter where you choose to define
your variable, the JavaScript engine will create the
variable at the start of the current scope. It will hold the value u n d e f i n e d until a statement is executed that gives it a value.

If you want to create variables that you want to be
able to give child properties to, you must define the
variable as an object. To define a variable as an
object, use either the n ew O b j e c t ( ) or { } syntax:

Am a little bit tired oo
I will continue the rest variable in the evening,
Stay alert

Part 3a
3b will continue in evening

@Emihorlamie@Uncle BigBay @
@Cheatex Jnr@naijaplus
@Rene Lopez @Supreme@Gkitng

thanks boss




Share This Post To The World

Users browsing this thread: 1 Guest(s)
Goto First Post In This Thread

Possibly Related Threads...
Thread Author Replies Views Last Post
  Lesson: Introduction To Javascript (part 1) flexible 12 18.8k 03-07-2018, 12:33 PM
Last Post: chidera
  CODE: Javascript Challenge Phase 1 Haarun 0 4.8k 25-06-2018, 11:04 PM
Last Post: Haarun
  Lesson: Introduction To Javascript (part 2) flexible 16 21k 04-03-2018, 09:48 AM
Last Post: flexible