Skip to content

Instantly share code, notes, and snippets.

@humayunahmed8
Last active June 28, 2018 10:56
Show Gist options
  • Save humayunahmed8/d8a558c55508781dd9f3c55a8541d462 to your computer and use it in GitHub Desktop.
Save humayunahmed8/d8a558c55508781dd9f3c55a8541d462 to your computer and use it in GitHub Desktop.
Javascipt Basic Syntax, (variable,contatinate,negation,datatypes,document.write,alert,getElementById,innerHTML)
Javascript Variable:
====================
1. You can use (A-Z) Capital Letter.
2. You can use (a-z) Shorthand Letter.
3. You will use (0-9) Numeric Number.
4. But, You can not write any numeric number in the frist of variable.
** Stucture: variable variable_name = variable_data;
** E.g : x = "Hello Bangladesh"
// Javascript Concatination
var firstName = 'Humayun';
var lastName = 'Ahmed';
document.write('My Name is: '+firstName+ ' ' +lastName); //Concatinate
// Negation Sign
var x = -10;
document.write(x);
document.write(-x);
// Datatype of Javascript
1. Boolean.
2. Null.
3. Undefined.
4. Number.
5. String.
6. Symbol.
7. Object.
var x = 5.5;
document.write(typeof(x));
// Document Print
document.write('My First Javascript Practice');
// Console Print
console.log('Hello Javascript');
// Alert Event
alert('I am Humayun');
// getElementById in innerHTML
document.write(document.getElementById('heading').innerHTML);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment