Giter Site home page Giter Site logo

freecodecamp-practice's Introduction

freecodecamp-practice

Practice everyday 嗯,还是issue用的顺手,基本内容都在issue,欢迎提问与回答

freecodecamp-practice's People

Contributors

nbr-hugh avatar

Watchers

James Cloos avatar

freecodecamp-practice's Issues

sort按顺序排列数组元素的原理是什么?理解的不是十分清楚

FCC中的解释:

Sort Arrays with sort
You can use the method sort to easily sort the values in an array alphabetically or numerically.
Unlike the previous array methods we have been looking at, sort actually alters the array in place. However, it also returns this sorted array.
sort can be passed a compare function as a callback. The compare function should return a negative number if a should be before b, a positive number if a should be after b, or 0 if they are equal.
If no compare (callback) function is passed in, it will convert the values to strings and sort alphabetically.

主要是这一段:

sort can be passed a compare function as a callback. The compare function should return a negative number if a should be before b, a positive number if a should be after b, or 0 if they are equal.

sort 可以通过比较函数作为回调函数(callback),假如 比较函数返回的是负值则a应该在b前,正值则b在a前,0则二者相等。

ok,那么新的疑问,回调函数(callback)是什么?

知乎的高分回答:
image

sf上的回答
这个解释get到点:

在JavaScript中,回调函数具体的定义为:函数A作为参数(函数引用)传递到另一个函数B中,并且这个函数B执行函数A。我们就说函数A叫做回调函数。如果没有名称(函数表达式),就叫做匿名回调函数。

ok,理解了回调函数是什么,那么迁移至具体情境,sout中比较函数是回调函数,即函数A, 那么函数B是什么呢?其中的运行原理无法理解

关于字符溢出序列的疑惑

Escape Sequences in Strings

Code Output
' single quote
" double quote
\ backslash
\n newline
\r carriage return
\t tab
\b backspace
\f form feed
Note that the backslash itself must be escaped in order to display as a backslash.

程序:
var myStr ="FirstLine\n\SecondLine\rThirdLine"
运行结果:
var myStr ="FirstLine\n\SecondLine\rThirdLine";

问题:无法理解这个挑战的知识点,小疑问:

  1. \r \t \b \f 的功能是什么? /n的功能我以为是换行,但是为什么第二次换行时的是\r?
    2.原本以为输出的结果是

FirstLine
\SecondLine
ThirdLine

但是运行结果怎么就是原码输出? 那这些功能还有什么意义? #

编程思考题

记录一些在学习编程过程中抽象层面的疑问

如何将文字与图片设置同一行并且相互适应?

采用div,class为row与col-md-_,改变_大小来改变位置

效果

http://codepen.io/NBR-hugh/pen/rroppb

程序

 <div class="row">
         <div class="col-md-8 text-left ">
           <h2>The New Of Front-End Developer </h2>
           <h3>Learning language:HTML,CSS,JavaScript</h3>
           <h3>The Begin Date:2016.10.16</h3>
         <h2>"Follew My Heart And Practice Hard !"</h2>
        </div>

         <div>
<img class=" img-reponsive  border" src="http://ww2.sinaimg.cn/small/8880bb4cjw1f8zopuiy0xj20hs0hsmy8.jpg" alt="头不见了……" >
         </div>          
    </div>

FCC:Basic Algorithm Scripting (50 hours)

16个小任务:

Get Set for our Algorithm Challenges Complete

Reverse a String Incomplete   * 完整反向一个字符串 17min

Factorialize a Number Incomplete   * 数的阶乘 1h40min

Check for Palindromes Incomplete   * 检查回文 2h23min

Find the Longest Word in a String Incomplete   * 寻找一个字符串中最长的单词 35min

Title Case a Sentence Incomplete   * 2h45min

Return Largest Numbers in Arrays Incomplete   * 返回数组中的最大值 45min

Confirm the Ending Incomplete   *确定结尾? 30min

Repeat a string repeat a string Incomplete   *重复字符串 10min

Truncate a string Incomplete   *缩短字符 40min

Chunky Monkey Incomplete   *矮胖的猴子 30min

Slasher Flick Incomplete   *惊悚电影 5min

Mutations Incomplete   *突变 33min

Falsy Bouncer Incomplete   * 27min

Seek and Destroy Incomplete   *寻找并且破坏 1h15min

Where do I belong Incomplete   *我属于哪里 23min

Caesars Cipher Incomplete   *凯撒密码 2h10min

余数作为系数为何错误?为何与负数时无法恰当工作?

Finding a Remainder in JavaScript中,说明如下:

The remainder operator % gives the remainder of the division of two numbers.

Example

5 % 2 = 1 because
Math.floor(5 / 2) = 2 (Quotient)
2 * 2 = 4
5 - 4 = 1 (Remainder)
Usage
In mathematics, a number can be checked even or odd by checking the remainder of the division of the number by 2.

17 % 2 = 1 (17 is Odd)
48 % 2 = 0 (48 is Even)
Note
The remainder operator is sometimes incorrectly referred to as the "modulus" operator. It is very similar to modulus, but does not work properly with negative numbers.

Instructions
Set remainder equal to the remainder of 11 divided by 3 using the remainder (%) operator.

其中的note部分看的不是很懂:

Note
The remainder operator is sometimes incorrectly referred to as the "modulus" operator. It is very similar to modulus, but does not work properly with negative numbers.

有时当小数作为系数(模数?)时运算不正确;小数与系数相似,但是遇到负数就无法正常工作。
理解的非常不通顺,为什么呢?该如何理解这段话?

如何将文字与图片置于一排并且可以调整?

采用div,class为row与col-md-_,改变_大小来改变位置

效果

http://codepen.io/NBR-hugh/pen/rroppb

程序

<div class="  row">
<div class=" col-md-1">
    </div>
        <div class="col-md-8 text-left "> 
           <h2>The New Of Front-End Developer </h2>
           <h3>Learning language:HTML,CSS,JavaScript</h3>
           <h3>The Begin Date:2016.10.16</h3>
           <h2>"Follew My Heart And Practice Hard !"</h2>
        </div>
         <div>
<img class=" img-reponsive  border" src="http://ww2.sinaimg.cn/small/8880bb4cjw1f8zopuiy0xj20hs0hsmy8.jpg" alt="头不见了……" >
         </div>          
    </div>

如何添加框架或是命令集?

在制作媒体图标外部链接时,想使用这个命令集:
Social Buttons for Bootstrap

网站中的使用说明是:

How to use

  1. Include Bootstrap and Font Awesome.If you haven't done that already, include the latest Bootstrap and Font Awesome in your project.
  2. Include the CSS or Less.You have two options for enabling the social buttons in your project: vanilla CSS or source Less. For vanilla CSS, just include the bootstrap-social.css file into your project.For Less, copy the bootstrap-social.less into your existing Bootstrap directory and import it into bootstrap.less via @import "bootstrap-social.less";. Recompile when ready.

说是要include the bootstrap-social.css file into your project.For Less, copy the bootstrap-social.
我根据提示在codepen的setting>add extral CSS 中添加框架网址是:
http://codepen.io/NBR-hugh/pen/rroppb/bootstrap-social.css
但是无法使用,请问应该如何添加框架或是命令集?

JSON APIs and Ajax (2 hours)

JSON

  • JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式。它基于JavaScript(Standard ECMA-262 3rd Edition - December 1999)的一个子集。 JSON采用完全独立于语言的文本格式,但是也使用了类似于C语言家族的习惯(包括C, C++, C#, Java, JavaScript, Perl, Python等)。这些特性使JSON成为理想的数据交换语言。 易于人阅读和编写,同时也易于机器解析和生成(网络传输速度)。

Ajax

  • Ajax:全称为“Asynchronous JavaScript and XML”(异步JavaScript和XML); 是指一种创建交互式网页应用的网页开发技术

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.