Skip to content

Instantly share code, notes, and snippets.

View arkhangelsk's full-sized avatar

Ambreen Khan arkhangelsk

View GitHub Profile
{
"userId": 1,
"id": 1,
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
"body": "awesome automation\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
}
function fib(n){
if (n<2) {
return 1;
}
else{
return fib(n-1)+fib(n-2);
}
}
function fib(n){
if (n<2) {
return n;
}
else{
return fib(n-1)+fib(n-2);
}
}
function fib(n)
{
let a = 1, b = 1, c;
if (n == 0)
return a;
for (let i = 2; i <= n; i++)
{
c = a + b;
a = b;
b = c;
@arkhangelsk
arkhangelsk / Factorial-Recursive.js
Last active June 14, 2019 03:17
Fibonacci - Iterative
function fact(n)
{
if (n <= 1) // This is the base case
return 1;
else
return n*fact(n-1);
}
module.exports = {
javascript: "You Don't know JS",
getJavaScript: function(){
return this.javascript;
}
};
{
"author": "Ambreen Khan",
"name": "fcc-learn-npm-package-json",
"dependencies": {
"express": "^4.14.0"
},
"main": "server.js",
"scripts": {
"start": "node server.js"
},
const courses = [
['Programming', 'Java', 250 ],
['Automation', 'Selenium', 200],
['General','Communication Skills', 100]
]
const classesAsObject = courses.map(([category, name, price]) => {
return {category, name, price} ;
});
function signup({coursename, username, email, password}){
//Code goes here...
}
const student = {
username: 'testuser',
password: 'testpassword',
email: 'testuser@tesing.com',
coursename: 'Selenium'
}
const courses = [
{category: 'Programming', name: 'Java', price: 250 },
{category: 'Automation', name: 'Selenium', price: 200},
{category: 'General', name: 'Communication Skills', price: 100}
]
const [ {name} ] = courses;
console.log(name);