THAPA TECHNICAL

HOUSE OF WEB DEVELOPERS AND TECHNOLOGY.

Build Facebook using JavaScript Only

Build Facebook using JavaScript Only


facebook in JavaScript



Welcome, all we will see how to build Facebook using JavaScript Only [Functionality]. JavaScript Facebook functionality. We will use an array and object to make Facebook using javascript. Where we will first ask the user to enter the Login details that is username and password.

Once then we will also, show the Status of the friends of that user by defining the condition and also using a function to check all is correct or not.



Here is the Source Code



 <script>

let database = [
{
username : 'vinod',
password : 'thapa',
}
];

let status = [
{
name : 'Thapatechnical',
status : 'I want 50K subscribers',
},
{
name : 'Thapa',
status : 'I will help Thapatechnical to get 50K subscriber',
}
];

const username = prompt('Enter your username');
const password = prompt('Enter your password');


const login = (user, pass) =>  {
if(user === database[0].username && pass === database[0].password){
// console.log(status);
for (let value of status){
console.log(value);
}
}else{
alert('Username or password is incorrect');
}
}

login(username,password );

</script>

No comments:

Post a Comment