SlideShare a Scribd company logo
Storage
Variables
Constants
Arrays
Kinds of Data
• User generated data
• Program Data
User Inputs
Storage
var msg="Hello World"
Program Data
User Generated Data
Input
User Generated Data
Interact
User Interaction
Program
Content
Program Data
Data available beforehand
Data processed via program
janData
janData
Variable
Variable and Constant
PI
PI
Constant
Storage
Storage
Variable
• Named storage location in memory
• By convention follow 'Camel Case' for naming
Eg:
– bigApple
– usbMic
• Value may change during program processing
• Can hold a single value
Variable
• Use word-let
let message = "Hello World";
alert (message);
let bigApple = 20;
alert(bigApple);
let user='Gauri', age= 20, message='Good Day';
alert(message + " "+user +" "+ age);
Constant
• Named storage location in memory
• By convention follow 'All Caps' for naming. Eg:
– BIGAPPLE
– USBMIC
• Value may never change during program
processing
• Can hold a single value
Constant
• Use word- const
const piv = 3.14;
window.alert("Value of pi: "+ piv);
Data Type
• Data is any form of information
• Number
– Integer
– Decimal
• String
– Combination of characters, integers and symbols
• Boolean
– Yes/No
Data Type
• Null
– Null value
• Undefined
– Variable or Constant that is not initialized
• Object
– Complex data structures
• Symbol
– Unique Identifiers
Array
• Named storage location in memory
• Can hold multiple values of same data type
• By convention follow 'Camel Case' for a variable array
name or 'All Caps' for a constant array name. Eg:
– bigApple
– usbMic
• Name should be plural since array is collection of
values.
• Value of variable array may change during program
processing
• Value of constant array may change during program
processing but cannot be reassigned
Array
23 45 33 65 76 77
7 4 3 6
apple[0] apple[1] apple[2] apple[3] apple[4] apple[5]
INTR[0] INTR[1] INTR[2] INTR[3]
An array index always starts from 0. If we have an array of 10
elements, then the elements to be referred to will be 0-9. Here,
the length of array will be 10.
For example: Integer array of 6 elements for storing the price of 6 varieties of
apple.
var apple = new Array(6);
apple[0] = 23;……
Integer array of 4 elements for storing the interest rate of 4 bank products
eg. Fixed Deposit, Saving A/c, Current A/c, Recurring Deposit will be constant.
const INTR = new Array(4);
JAN
FEB
MAR
APR
MAY
JUN
JAN
FEB
MAR
APR
MAY
JUN
Array
Array
Difference
Variables Constants Arrays
Value may vary. Value can
change once or multiple
times via processing
during the lifetime of
program.
Value remains constant.
Cannot change through
out the lifetime of
program.
Value may vary for each
element individually
during the lifetime of
program.
Stores single value Stores single value Stores multiple values
depending on the length
of array in different
elements.
Storing data in JS
https://www.codewizacademy.com
https://www.facebook.com/codewizacademy/
https://www.instagram.com/codewizacademy/

More Related Content

PDF
InfiniFlux Minmax Cache
PPTX
Heap Sort in Design and Analysis of algorithms
PDF
4 heapsort pq
PPTX
Heap Sort Algorithm
PPTX
Array vs array list
PPTX
Arrays accessing using for loops
PPT
1.10.association mining 2
PPT
1.11.association mining 3
InfiniFlux Minmax Cache
Heap Sort in Design and Analysis of algorithms
4 heapsort pq
Heap Sort Algorithm
Array vs array list
Arrays accessing using for loops
1.10.association mining 2
1.11.association mining 3

What's hot (9)

PPT
A vertical representation in frequent item set mining
PPT
Apriori and Eclat algorithm in Association Rule Mining
PPTX
Heaptree
PPTX
Apriori algorithm
PPT
1.9.association mining 1
PPTX
ArrayList in JAVA
PPTX
Data structures and algorithms arrays
PPTX
Apriori algorithm
PPT
Heap Sort || Heapify Method || Build Max Heap Algorithm
A vertical representation in frequent item set mining
Apriori and Eclat algorithm in Association Rule Mining
Heaptree
Apriori algorithm
1.9.association mining 1
ArrayList in JAVA
Data structures and algorithms arrays
Apriori algorithm
Heap Sort || Heapify Method || Build Max Heap Algorithm
Ad

Similar to Storage in programming (20)

PPTX
CPP05 - Arrays
PPTX
UiPath Studio Web workshop series - Day 2
PPTX
Introduction to java Programming Language
PPTX
Introduction to JcjfjfjfkuutyuyrsdterdfbvAVA.pptx
PDF
JavaOne 2013: Memory Efficient Java
PDF
Essbase Statistics DW: How to Automatically Administrate Essbase Using ODI
PDF
Java Basics.pdf
PDF
MLProjectReport
PDF
CSC111-Chap_02.pdf
PPTX
Object oriented programming2 Week 2.pptx
PDF
So you want to liberate your data?
DOCX
Sample Questions The following sample questions are not in.docx
PPTX
advancedzplmacroprogramming_081820.pptx
PPTX
Low memory footprint programs-iSeries
PPTX
Core java
PPTX
Core java
PDF
Data herding
PDF
Data herding
PPTX
Core java
CPP05 - Arrays
UiPath Studio Web workshop series - Day 2
Introduction to java Programming Language
Introduction to JcjfjfjfkuutyuyrsdterdfbvAVA.pptx
JavaOne 2013: Memory Efficient Java
Essbase Statistics DW: How to Automatically Administrate Essbase Using ODI
Java Basics.pdf
MLProjectReport
CSC111-Chap_02.pdf
Object oriented programming2 Week 2.pptx
So you want to liberate your data?
Sample Questions The following sample questions are not in.docx
advancedzplmacroprogramming_081820.pptx
Low memory footprint programs-iSeries
Core java
Core java
Data herding
Data herding
Core java
Ad

More from Codewizacademy (20)

PPTX
Implementing OODA Loop in online teaching
PPTX
Tie up loose ends
PPTX
PPTX
PPTX
PPTX
Organizing content of course
PPTX
Rules and policies for course
PPTX
Content Creation
PPTX
Taxonomies
PPTX
Course outline
PPTX
Course development
PPTX
PPTX
Conditional Constructs in Javascript
PPTX
Displaying message on web page in Javascript
PPTX
Programming fundamentals through javascript
PPTX
Cyber Security
PPTX
Website Security
PPTX
Website Cookies
PPTX
GDPR- General Data Protection Regulation
PPTX
CSS- Cascading Style Sheet
Implementing OODA Loop in online teaching
Tie up loose ends
Organizing content of course
Rules and policies for course
Content Creation
Taxonomies
Course outline
Course development
Conditional Constructs in Javascript
Displaying message on web page in Javascript
Programming fundamentals through javascript
Cyber Security
Website Security
Website Cookies
GDPR- General Data Protection Regulation
CSS- Cascading Style Sheet

Recently uploaded (20)

PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
01-Introduction-to-Information-Management.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Trump Administration's workforce development strategy
PPTX
Lesson notes of climatology university.
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
Classroom Observation Tools for Teachers
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Complications of Minimal Access Surgery at WLH
PPTX
Microbial diseases, their pathogenesis and prophylaxis
2.FourierTransform-ShortQuestionswithAnswers.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
01-Introduction-to-Information-Management.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Final Presentation General Medicine 03-08-2024.pptx
A systematic review of self-coping strategies used by university students to ...
O5-L3 Freight Transport Ops (International) V1.pdf
Trump Administration's workforce development strategy
Lesson notes of climatology university.
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Classroom Observation Tools for Teachers
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Supply Chain Operations Speaking Notes -ICLT Program
Complications of Minimal Access Surgery at WLH
Microbial diseases, their pathogenesis and prophylaxis

Storage in programming

  • 2. Kinds of Data • User generated data • Program Data User Inputs Storage var msg="Hello World" Program Data
  • 3. User Generated Data Input User Generated Data Interact User Interaction Program Content
  • 4. Program Data Data available beforehand Data processed via program
  • 6. Variable • Named storage location in memory • By convention follow 'Camel Case' for naming Eg: – bigApple – usbMic • Value may change during program processing • Can hold a single value
  • 7. Variable • Use word-let let message = "Hello World"; alert (message); let bigApple = 20; alert(bigApple); let user='Gauri', age= 20, message='Good Day'; alert(message + " "+user +" "+ age);
  • 8. Constant • Named storage location in memory • By convention follow 'All Caps' for naming. Eg: – BIGAPPLE – USBMIC • Value may never change during program processing • Can hold a single value
  • 9. Constant • Use word- const const piv = 3.14; window.alert("Value of pi: "+ piv);
  • 10. Data Type • Data is any form of information • Number – Integer – Decimal • String – Combination of characters, integers and symbols • Boolean – Yes/No
  • 11. Data Type • Null – Null value • Undefined – Variable or Constant that is not initialized • Object – Complex data structures • Symbol – Unique Identifiers
  • 12. Array • Named storage location in memory • Can hold multiple values of same data type • By convention follow 'Camel Case' for a variable array name or 'All Caps' for a constant array name. Eg: – bigApple – usbMic • Name should be plural since array is collection of values. • Value of variable array may change during program processing • Value of constant array may change during program processing but cannot be reassigned
  • 13. Array 23 45 33 65 76 77 7 4 3 6 apple[0] apple[1] apple[2] apple[3] apple[4] apple[5] INTR[0] INTR[1] INTR[2] INTR[3] An array index always starts from 0. If we have an array of 10 elements, then the elements to be referred to will be 0-9. Here, the length of array will be 10. For example: Integer array of 6 elements for storing the price of 6 varieties of apple. var apple = new Array(6); apple[0] = 23;…… Integer array of 4 elements for storing the interest rate of 4 bank products eg. Fixed Deposit, Saving A/c, Current A/c, Recurring Deposit will be constant. const INTR = new Array(4);
  • 15. Difference Variables Constants Arrays Value may vary. Value can change once or multiple times via processing during the lifetime of program. Value remains constant. Cannot change through out the lifetime of program. Value may vary for each element individually during the lifetime of program. Stores single value Stores single value Stores multiple values depending on the length of array in different elements.
  • 16. Storing data in JS https://www.codewizacademy.com https://www.facebook.com/codewizacademy/ https://www.instagram.com/codewizacademy/